Repository navigation
feat: report the step a gzipInPlace error came from - #82
Merged
Merged
Conversation
gzipInPlace returns the same error set from every step. A caller cannot tell a log left as it was from a log whose archive is in place with the original removed and only the final directory sync failed. A rotate that counts compressed logs needs that difference. Guessing it from the error value or from a stat afterwards is wrong when another process changes the same directory. gzipInPlaceAtStep takes a GzipStep out-parameter. It starts as archive and becomes directory_sync once the archive is renamed into place and the original removed, right before the archive's directory is opened and synced. On an archive error the original file stays in place and the call left no archive. On a directory_sync error the archive is in place and the original is gone. gzipInPlace keeps its signature and calls gzipInPlaceAtStep with a step of its own. One test refuses an existing archive and a missing log, and expects archive both times with the log left in place. The other test lowers the soft descriptor limit to just above the two descriptors the archive step needs. Opening the directory for the sync is then the first call refused. That test expects directory_sync, EMFILE, an archive that gzip -t accepts and no original. Both tests fail to build on the parent, which has no gzipInPlaceAtStep.
HaoZeke
force-pushed
the
feat/gzip-step-report
branch
from
November 25, 2026 02:32
e498079 to
2d442d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gzipInPlace returns the same error set from every step. A caller cannot
tell a log left as it was from a log whose archive is in place with the
original removed and only the final directory sync failed. A rotate that
counts compressed logs needs that difference. Guessing it from the error
value or from a stat afterwards is wrong when another process changes
the same directory.
gzipInPlaceAtStep takes a GzipStep out-parameter. It starts as archive
and becomes directory_sync once the archive is renamed into place and
the original removed, right before the archive's directory is opened
and synced. On an archive error the original file stays in place and
the call left no archive. On a directory_sync error the archive is in
place and the original is gone. gzipInPlace keeps its signature and
calls gzipInPlaceAtStep with a step of its own.
One test refuses an existing archive and a missing log, and expects
archive both times with the log left in place. The other lowers the
soft descriptor limit to just above the two descriptors the archive
step needs, so the open of the directory for its sync is the first
call refused. It expects directory_sync, EMFILE, an archive that
gzip -t accepts and no original. Both fail to build on the parent,
which has no gzipInPlaceAtStep.