-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rubygems does not terminate on failed file lock when not superuser #1582
Conversation
As a note for anyone looking at this, this still needs tests. |
Looking at the error Travis CI returns: Line 841 is a comment. I have no idea what it's doing. I am completely lost as to what the hell Appveyor is doing. |
According to GH, line 841 is |
Okay, something was up locally. That's what I'm seeing locally now, too. As for the actual issue, it looks like
|
Oh! I see what the issue is. I need to return |
Well, that's Travis errors fixed. Appveyor failure is caused by #1586. |
io.flock(File::LOCK_EX) | ||
begin | ||
io.flock(File::LOCK_EX) | ||
rescue Errno::ENOTSUP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will fail on 1.8.7 as well, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it, yeah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@segiddins the issue I'm running into here is since it only has one class, if I use the approach that was used for Gem.read_binary
, then on 1.8.7 it'll be equivalent to this:
begin
io.flock(File::LOCK_EX)
rescue
end
which seems... bad?
Any idea how to approach this?
Rebased, since Appveyor builds have been fixed on master. |
@segiddins do you have any thoughts on how to approach testing this? I'm having trouble wrapping my head around what exactly needs testing; it seems like 2-3 things need tests for both |
open(path, 'wb') do |io| | ||
begin | ||
io.flock(File::LOCK_EX) | ||
rescue Errno::ENOTSUP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't ENOTSUP
be undefined here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
this looks good, other than the failing specs |
Behold, the mighty question mark, breaker of tests. (I have to begrudgingly admit I committed without running the tests locally...) |
@segiddins specs are fixed, btw. |
@HoMr r+ |
@segiddins you @'d @HoMr instead of @homu. |
@homu r+ |
📌 Commit 23d8e9c has been approved by |
Rubygems does not terminate on failed file lock when not superuser # Description: Supersedes PR #1536. Fixes issue #1535. # Tasks: - [x] Describe the problem / feature - [ ] Write tests - [x] Write code to solve the problem - [ ] Get code review from coworkers / friends - [ ] [Squash commits](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
☀️ Test successful - status |
Description:
Supersedes PR #1536.
Fixes issue #1535.
Tasks:
I will abide by the code of conduct.