Merge ~pappacena/launchpad:mirror-prober-untwist-db-calls into launchpad:master
Status: | Merged |
---|---|
Approved by: | Thiago F. Pappacena |
Approved revision: | b234886a7b278833a26b6c66795897cc596d20ab |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~pappacena/launchpad:mirror-prober-untwist-db-calls |
Merge into: | launchpad:master |
Diff against target: |
412 lines (+233/-17) 2 files modified
lib/lp/registry/scripts/distributionmirror_prober.py (+101/-16) lib/lp/registry/tests/test_distributionmirror_prober.py (+132/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+394494@code.launchpad.net |
Commit message
Moving responses processing out of reactor on mirror prober to avoid fake HTTP timeouts
Description of the change
Ideally, we should keep the reactor free to do the HTTP requests as fast as possible, and move all other processing (specially database calls) to outside the event loop. This refactoring is meant to keep track of the callback calls being made, in order to run them after the reactor finishes the job of doing the batch HTTP requests.
Unfortunately, the archive prober needs the response of a first HTTP call to do some database operations, and after that it shoots several other HTTP calls. Since the original bug report is not about the archive prober, we keep this other refactoring for the future.
This is pretty difficult to follow, but I'm OK with it if it works.
However, did you consider instead using storm.twisted. transact for this? It's designed for this sort of thing, and it might be possible to use it to make things significantly easier to follow.