Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
tar: Avoid error when file grows during copy #227
Conversation
|
$$william_lgtm$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju-utils |
jujubot
merged commit 9e19645
into
juju:1.25
Jul 29, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bz2 commentedJul 29, 2016
•
Edited 1 time
-
ericsnowcurrently
Jul 29, 2016
Fixes lp:1457575 at the utils/tar level.
The symptom being seen in juju is "archive/tar: write too long"
during backup. This comes from the log file that is being added
to the tar being appended to between the point the size is taken
from stat and put in the tar header, and io.Copy finishing.
Simply using io.CopyN instead limiting the size written to what
the header specifies is sufficient to avoid the issue.
(Review request: http://reviews.vapour.ws/r/5334/)