Merge ~cjwatson/launchpad:librarian-timeouts into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | f3e4e01c00921b293a27c588640a68e799a8525f |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:librarian-timeouts |
Merge into: | launchpad:master |
Diff against target: |
146 lines (+69/-8) 3 files modified
lib/lp/services/config/schema-lazr.conf (+4/-0) lib/lp/services/librarian/client.py (+16/-8) lib/lp/services/librarian/tests/test_client.py (+49/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+433219@code.launchpad.net |
Commit message
Add a socket timeout for librarian client connections
Description of the change
The internal librarian client creates a socket with no timeout, so if anything goes wrong with the connection then it only recovers by being killed manually. Add a socket timeout so that it gives up eventually. (Note that this timeout applies to individual operations on the socket, not to uploading or downloading entire files.)
The default timeout is deliberately quite generous to minimize the chance of causing failures due to connections being merely slow rather than stuck, although we may still find we need to tune it. This isn't intended to ensure that librarian requests fit within timeout budgets set for web requests or similar, but just as a backstop to ensure that we don't get stuck waiting forever.
I do trust you know what you are doing, but I would appreciate some clarifying answers/comments.