Skip to content

LOGBACK-992: do not delete the original file when compression fails - #1058

Open
aysha-afrah26 wants to merge 1 commit into
qos-ch:masterfrom
aysha-afrah26:fix/compression-failure-deletes-original
Open

LOGBACK-992: do not delete the original file when compression fails#1058
aysha-afrah26 wants to merge 1 commit into
qos-ch:masterfrom
aysha-afrah26:fix/compression-failure-deletes-original

Conversation

@aysha-afrah26

Copy link
Copy Markdown

When compression of a rolled log file fails (e.g. disk full), all three compression strategies swallow the exception and then delete the original file anyway leaving only a truncated, unusable archive. The rolled log data is permanently lost, and the leftover partial file blocks any retry with target compressed file exists already.

This makes the delete conditional on success: on failure the original file is kept and the partial archive is removed. Same intent as the long-open #273 (LOGBACK-992), which predates the current CompressionStrategy classes . this version targets the current code and adds a regression test (fails on master, passes with the fix). Related reports: #863, #921.

Signed-off-by: aysha-afrah26 <aysha26@digiscrypt.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant