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

prevent tempfile path from being unlinked by garbage collection #185

Merged
merged 1 commit into from
Jan 16, 2015

Conversation

maneframe
Copy link
Contributor

In one of our tests, we noticed that we were getting intermittent Errno::ENOENT: No such file or directory errors here when reaching ::File.rename(tmp_filename, self.name).

After some investigation I found that the garbage collector happened to be running the finalizer for tmpfile during the entry writing block in File#commit, which tries to unlink the file (and succeeds if you're on a non-Windows environment).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 3b639b6 on maneframe:master into 8ede424 on rubyzip:master.

simonoff added a commit that referenced this pull request Jan 16, 2015
prevent tempfile path from being unlinked by garbage collection
@simonoff simonoff merged commit a23b306 into rubyzip:master Jan 16, 2015
simonoff added a commit that referenced this pull request Jan 4, 2016
Fix accidental unlink (#185) without using ObjectSpace (#252)
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.

None yet

3 participants