-
Notifications
You must be signed in to change notification settings - Fork 113
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
archive.Extract
Race
#719
Labels
Comments
Merged
@ryanmoran thanks for reporting this. We'll try to get a fix out soon. |
@ryanmoran this should be fixed in 0.12.0 by #730. Could you let us know if the issue you were seeing is resolved? |
@natalieparellano I can confirm that I am now seeing stable file permissions. Thanks for the fix! |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Summary
The implementation of
archive.Extract
is not thread-safe, but is called from goroutine code, causing non-deterministic behavior. Specifically,archive.Extract
clears and then resets the globalumask
value. This value cannot be modified safely from within a goroutine.This was discovered while we were debugging a report in the Paketo
go-dist
buildpack. On subsequent builds, the buildpack appeared to produce a layer whose content changed when there were no changes to any of the inputs that might have caused a new layer to be created. Instead, when comparing layers between builds, we noticed that the permissions of the layer directories themselves were different. After some head scratching and tracing of our own code, we became convinced that this must be an issue with the lifecycle. That is when we discovered thearchive.Extract
code that mutates the globalumask
value and the concurrent code that invokesarchive.Extract
.We've created a simplified reproduction program to isolate the issue.
Reproduction
Steps
go run main.go --order serial
and witness that theumask
values remain unchanged from beginning to end.go run main.go --order parallel
and witness that theumask
value is mutated (somewhat non-deterministically).Current behavior
The lifecycle mutated the global value of
umask
leading to non-deterministic permissions when creating directories.Expected
The lifecycle should set the value of
umask
back to its original state after modification in a thread-safe manner.Context
lifecycle version
0.11.4
platform version(s)
The text was updated successfully, but these errors were encountered: