Merge ~twom/launchpad:fix-race-condition-in-contents-files into launchpad:master
Proposed by
Tom Wardill
Status: | Merged |
---|---|
Approved by: | Tom Wardill |
Approved revision: | e2859a79ac0c3c4ee2a2db20269df6fd7058b20a |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~twom/launchpad:fix-race-condition-in-contents-files |
Merge into: | launchpad:master |
Diff against target: |
72 lines (+21/-5) 1 file modified
lib/lp/archivepublisher/model/ftparchive.py (+21/-5) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email:
|
Commit message
Fix race conditions in contents files
Description of the change
A race condition between generateOverrides and listFiles meant that the files were being read as they were being written, occasionally leading to the contents being empty.
This MP changes the file writing behaviour of both methods to write to a '.new' file, then use rename to move the file into the final location. This should be an atomic operation and prevent the zero length files from occurring.
To post a comment you must log in.