Merge lp:~cjwatson/launchpad-buildd/large-build-artifacts into lp:launchpad-buildd
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Colin Watson | ||||
Approved revision: | 80 | ||||
Merged at revision: | 78 | ||||
Proposed branch: | lp:~cjwatson/launchpad-buildd/large-build-artifacts | ||||
Merge into: | lp:launchpad-buildd | ||||
Diff against target: |
198 lines (+71/-34) 5 files modified
debian/changelog (+4/-0) lpbuildd/binarypackage.py (+12/-7) lpbuildd/debian.py (+37/-13) lpbuildd/slave.py (+17/-12) lpbuildd/sourcepackagerecipe.py (+1/-2) |
||||
To merge this branch: | bzr merge lp:~cjwatson/launchpad-buildd/large-build-artifacts | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+186503@code.launchpad.net |
Commit message
Avoid trying to read entire log or result files into memory in one go.
Description of the change
This branch rearranges the buildd slave to avoid trying to read entire log or result files into memory in one go.
For result files, this is fairly trivial. For log files, we have to search them so it's not so trivial. However, matches will not span the whole file, so we can do this using a sliding window.
This has efficiency problems of its own. I think they'll generally be acceptable for the moment; for instance I can use this code to search a 2GB file for three regexes in 31 seconds on my laptop, and grep takes 11 seconds for one regex; also, we used to read the entire file in some cases even if we weren't going to search it (e.g. successful builds), so this should improve slave throughput regardless.
I'd consider doing storeFile in one pass by writing to a temporary file first. We made a similar change in the other cache code to avoid leaving truncated files on failure, so it'd be a double win. But it's less important here.