Skip to content

Allow repeated close of any IO to succeed.#5713

Open
headius wants to merge 1 commit intojruby:masterfrom
headius:silence_repeat_io_close
Open

Allow repeated close of any IO to succeed.#5713
headius wants to merge 1 commit intojruby:masterfrom
headius:silence_repeat_io_close

Conversation

@headius
Copy link
Member

@headius headius commented Apr 25, 2019

This relates to #5709 but breaks at least one spec:

File.open opens a file with a file descriptor d and a block FAILED
Expected Errno::EBADF but no exception was raised (nil was returned)
/Users/headius/projects/jruby/spec/ruby/core/file/open_spec.rb:173:in `block in <main>'

There may be other failures, but it's debateable whether they
represent behavior we need to emulate.

This relates to jruby#5709 but breaks at least one spec:

```
File.open opens a file with a file descriptor d and a block FAILED
Expected Errno::EBADF but no exception was raised (nil was returned)
/Users/headius/projects/jruby/spec/ruby/core/file/open_spec.rb:173:in `block in <main>'
```

There may be other failures, but it's debateable whether they
represent behavior we need to emulate.
@headius
Copy link
Member Author

headius commented Apr 26, 2019

Looks like there's other failures, but I'm still unconvinced if the differing behavior is important.

headius added a commit to headius/jruby that referenced this pull request Jun 4, 2019
This allows failed connections from sockets (jruby#5709, jruby#5754) to
raise the actual socket error even though the logic in socket.rb
tries to close the failed socket.

This approach differs from jruby#5713 in that it modifies the final
flush logic to skip closed channels rather than modifying the
IO#closed? logic to do that same check.
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.

1 participant