-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tar corruption when writing active files #820
Comments
I seemingly can't use that patch file Any chance of a PR? |
I can't find a way to create a branch for the PR. I do have my complete git diff here:
|
Fixed tarCorruption.patch |
modified the patch a little as my client corrupted it I think Please validate the PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use the library to compress logs in a streaming manner, without saving a temporary file or storing to memory (RAM and diskspace restriction).
When I use the tar writer to archive active files (logs) the size of the tar header doesn't match the file in the tar, because the file has increased in size between the time the header was created and the file was fully read.
This result in the tar entry being corrupted, and sometime it can also result in the file in question not being recoverable.
Repro steps: Create a tar archive with a file that is being written in actively.
The fix is to stop reading the file at the size set by the tar header. Attached is the proposed fix as a git patch
tarCorruption.patch
The text was updated successfully, but these errors were encountered: