Merge lp:~stub/launchpad/garbo into lp:launchpad
Proposed by
Stuart Bishop
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Jeroen T. Vermeulen | ||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||
Merged at revision: | not available | ||||||||||||
Proposed branch: | lp:~stub/launchpad/garbo | ||||||||||||
Merge into: | lp:launchpad | ||||||||||||
Diff against target: |
192 lines (+39/-27) 2 files modified
lib/canonical/launchpad/doc/looptuner.txt (+4/-11) lib/canonical/launchpad/utilities/looptuner.py (+35/-16) |
||||||||||||
To merge this branch: | bzr merge lp:~stub/launchpad/garbo | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email: mp+22680@code.launchpad.net |
Commit message
Let garbo tasks timeout while waiting for replication lag or long running transactions
Description of the change
garbo-*.py lets a timeout be set for tasks so they abort if they don't complete withing a given time frame. This timeout is not checked for when blocking for long running transactions or for replication lag.
This branch fixes that. Now tasks will correctly be aborted when they timeout and report this, rather than block indefinitely.
To post a comment you must log in.
Hi Stuart,
Nice to see loop tuning continue to get better. One design question: your timeout check accompanies time.sleep calls. Why not have:
* An attribute flag that says "I consider myself timed out" (even if it hasn't happened yet but is bound to happen because of impending sleep)
* A _checkTimeLeft( seconds= 0) method that you call in various places to set the timeout flag if the requisite number of seconds isn't available
* A self.sleep method that checks for remaining time and time.sleeps only if the sleep ends before the deadline, so you don't have to check this for every time.sleep
* Instead of time checks, a check for the timeout flag.
On a more nitpicky note, _is_timed_out is not the right spelling for a method; that'd be _isTimedOut. And I don't see the point of a leading underscore in _msg_counter.
Jeroen