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

Fix IO#syswrite. Fixes #3799 #4123

Merged
merged 1 commit into from Nov 22, 2016
Merged

Conversation

etehtsea
Copy link
Contributor

As a result of debugging I found out that SystemCallError that happens during syswrite is actually "Resource temporarily unavailable" that corresponds to EAGAIN. So first idea of fix was to put select somewhere. Related fix for IO#sysread gave me hope that I'm moving in right direction.

As a result I did similar fix as in 857b76f

@headius
Copy link
Member

headius commented Sep 6, 2016

@etehtsea I do not see the equivalent logic in MRI's implementation, which makes me reluctant to include this. I think the actual problem may be that jnr-unixsocket is not properly doing a blocking write, or the UNIX socket is getting set non-blocking for some reason.

I think we should try to investigate from the bottom up and figure out why jnr-unixsocket's write is not blocking and handling EAGAIN the same way as the write call MRI makes.

@etehtsea
Copy link
Contributor Author

etehtsea commented Nov 16, 2016

@headius, updated. Needs new jnr-enxio snapshot with jnr/jnr-enxio#23 merged in.
Hope this time I fixed it right.

@etehtsea etehtsea changed the title IO#syswrite should always block. Fixes #3799 Fix IO#syswrite. Fixes #3799 Nov 16, 2016
@headius headius merged commit 723f2da into jruby:master Nov 22, 2016
@headius headius added this to the JRuby 9.1.7.0 milestone Nov 22, 2016
@etehtsea etehtsea deleted the gh-3799-syswrite-block branch November 22, 2016 05:32
@etehtsea etehtsea restored the gh-3799-syswrite-block branch November 22, 2016 05:32
@headius
Copy link
Member

headius commented Nov 22, 2016

Thank you!

@etehtsea etehtsea deleted the gh-3799-syswrite-block branch November 22, 2016 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants