Merge ~cjwatson/launchpad-buildd:revoke-proxy-token-timeout into launchpad-buildd:master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 2cf20c8af5ace95141c9bc393274daa3d769f57e |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad-buildd:revoke-proxy-token-timeout |
Merge into: | launchpad-buildd:master |
Diff against target: |
59 lines (+10/-3) 4 files modified
debian/changelog (+3/-0) lpbuildd/proxy.py (+1/-1) lpbuildd/tests/test_charm.py (+3/-1) lpbuildd/tests/test_snap.py (+3/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+425211@code.launchpad.net |
Commit message
Add a timeout when revoking proxy tokens
Description of the change
We should have a timeout when making external requests so that builders don't get tied up indefinitely if the external service in question doesn't respond for whatever reason. The builder proxy applies a maximum lifetime to tokens, so the worst case of failing to revoke a token is that it ends up being valid for a little longer than necessary.
To post a comment you must log in.
Indeed. All network requests should have a timeout.
Having a look at the docstring of `urlopen`, the timeout is set by default to `socket. _GLOBAL_ DEFAULT_ TIMEOUT` .
I tried to find out more about that global timeout, but it looks like this is just a placeholder, ie `object()`. The docstring also is not really helpful. By chance, did you encounter this and do you know where this default value is set and if there is even a number?