Skip to content
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

Error when too few bytes are read #234

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

tempusfrangit
Copy link
Contributor

In the case where we have a scenario that results in fewer than expected bytes being read from the tar compression or fewer than expected bytes written from the file writer consumer, propagate an error to the main program and exit with non-success status.

Observed behavior shows that within the tar-extraction code path in certain circumstances a clean EOF is received by the tarReader and the archive is partially extracted. This generally presents as files missing in the destination directory.

New code paths expect the correct number of bytes to be read or it will propagate a non-zero exit.

In the case where we have a scenario that results in fewer than expected
bytes being read from the tar compression or fewer than expected bytes
written from the file writer consumer, propagate an error to the main
program and exit with non-success status.

Observed behavior shows that within the tar-extraction code path in
certain circumstances a clean EOF is received by the tarReader and the
archive is partially extracted. This generally presents as files missing
in the destination directory.

New code paths expect the correct number of bytes to be read or it will
propagate a non-zero exit.
tempusfrangit and others added 2 commits December 2, 2024 15:18
and `*testing.T.Cleanup` instead of `defer` plus constifying `1024`
Copy link
Contributor

@meatballhat meatballhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2️⃣ ➕ 2️⃣ 🟰 5️⃣

@tempusfrangit tempusfrangit merged commit f56ac41 into main Dec 3, 2024
5 checks passed
@tempusfrangit tempusfrangit deleted the error-on-less-than-expected-bytes-read branch December 3, 2024 05:17
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.

2 participants