Merge lp:~abentley/launchpad/memlimit-sendbranchmail into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13420 |
Proposed branch: | lp:~abentley/launchpad/memlimit-sendbranchmail |
Merge into: | lp:launchpad |
Diff against target: |
388 lines (+117/-50) 8 files modified
cronscripts/sendbranchmail.py (+12/-15) lib/lp/code/model/branchjob.py (+60/-11) lib/lp/code/scripts/tests/test_sendbranchmail.py (+10/-10) lib/lp/codehosting/vfs/transport.py (+10/-1) lib/lp/registry/model/packagingjob.py (+2/-11) lib/lp/services/utils.py (+20/-2) lib/lp/translations/model/translationpackagingjob.py (+1/-0) lib/lp/translations/tests/test_translationtemplatesbuildjob.py (+2/-0) |
To merge this branch: | bzr merge lp:~abentley/launchpad/memlimit-sendbranchmail |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Aaron Bentley (community) | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2011-06-23.
Commit message
Memory-limit branch mail jobs.
Description of the change
The original landing was rolled back because it failed in production. The production failures appear to be because there was a wrapper script on production that was setting the hard limit lower than 2.0 GB. This version uses the same memory limit as the wrapper script's hard limit.
= Summary =
Fix bug #585126: sendbranchmail with lp:~vcs-imports/linux/trunk is eating memory
== Proposed fix ==
Introduce a memory limit to branch mail jobs.
== Pre-implementation notes ==
None
== Implementation details ==
The TwistedJobRunner now supports memory limits for jobs, which means that each job runs in a separate process, and raises a MemoryError if it exceeds allowable memory use. This branch uses that mechanism for the sendbranchmail jobs.
In order to use the memory limit, we must switch to the TwistedJobRunner. In order to use the TwistedJobRunner, we need a suitable job source, so BranchMailJobSource was implemented. In order to implement BranchMailJobSo
There were several drivebys as well:
AsyncVirtualServer can now behave as a ContextManager, meaning that the following works:
with get_ro_server():
server_ops
Old bzr workarounds that are no longer needed were deleted.
Lots of lint was fixed
== Tests ==
bin/test -vt sendbranchmail -t branchjob
== Demo and Q/A ==
Not sure whether this is QAable.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
cronscripts/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
Looks good.
[1]
+ @staticmethod subclass( cls): agingJob) need to be able to override it and call
+ def _register_
+ """Register this class with its enumeration."""
+ # This would be a classmethod, except that subclasses (e.g.
+ # TranslationPack
+ # into it, and there's no syntax to call a base class's version of a
+ # classmethod with the subclass as the first parameter.
I think super(BranchJob Derived, cls)._register_ subclass( ) might work.
[2]
+class BranchMailJobSo urce(BaseRunnab leJobSource) :
+ """Source of jobs that send mail about branches."""
+
+ memory_limit = 2 * (1024 ** 3)
2GB is quite a high limit. Is that correct?