Merge lp:~adeuring/launchpad/bug-750274 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Aaron Bentley | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13151 | ||||
Proposed branch: | lp:~adeuring/launchpad/bug-750274 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
107 lines (+44/-6) 2 files modified
lib/canonical/librarian/client.py (+10/-6) lib/canonical/librarian/ftests/test_client.py (+34/-0) |
||||
To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-750274 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email: mp+63129@code.launchpad.net |
Commit message
[r=abentley][no-qa] FileUploadClient does no longer treat a very fast 200 response from the server while uploading an empty file as an error.
Description of the change
I hope that this branch fixes bug 750274: librarian.txt fails sometimes. I find it hard to be sure that a patch really fixes all possible causes for such a low-level communication problem, but I think my suspicion about the cause is reasonable:
Both tracebacks mentioned in the bug report show that the error occurs when an empty file is uploaded. In other words: The client sends only a few header lines and nothing more. After sending these header lines, the server is supposed to return a success response -- and it does so.
The problem is the error check in FileUploadClien
If the server responds quick enough, the select() call in _checkError() succeeds, and the method raises UploadFailed(). I suspect that this happens when the kernel's process manager switches from the client process to the server process after "self.state.
This is a very small time window, so the error occurs only quite seldom.
The fix is obvious: the sendLine() call for the empty line signalling "all headers sent" should not check if the server responded, if an empty file is uploaded. addFile() does the final check of the server's response a few lines below the the last _sendLine() call.
test: ./bin/test canonical -vvt test_client