Merge lp://qastaging/~julian-edwards/launchpad/log-parser-bug-680463 into lp://qastaging/launchpad

Proposed by Julian Edwards
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 11988
Proposed branch: lp://qastaging/~julian-edwards/launchpad/log-parser-bug-680463
Merge into: lp://qastaging/launchpad
Diff against target: 24 lines (+7/-6)
1 file modified
lib/lp/services/apachelogparser/base.py (+7/-6)
To merge this branch: bzr merge lp://qastaging/~julian-edwards/launchpad/log-parser-bug-680463
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+41865@code.qastaging.launchpad.net

Commit message

When parsing Apache logs, figure out the length of gzip log files without having to read them in to memory in their entirety which can cause the process to crash when it eats all the available memory.

Description of the change

Figure out the length of gzip log files without having to read them in to memory.

The existing code tries to read the uncompressed contents of a gzip file into memory in their entirety. This makes the PPA log parser blow up quite horribly as the log files are very large.

Use existing test with:
bin/test -cvv test_apachelogparser Test_get_fd_and_file_size

QA Plan
-------

I have got a copy of the production log files that cause the crash on dogfood. Running with the fix allows the processing to continue with no increased memory usage as observed in "top".

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.