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

@etehtsea etehtsea commented Aug 31, 2016

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 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 etehtsea force-pushed the gh-3799-syswrite-block branch from ea714e8 to bfcec47 Nov 16, 2016
@etehtsea
Copy link
Contributor Author

@etehtsea 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
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
@headius headius added this to the JRuby 9.1.7.0 milestone Nov 22, 2016
@etehtsea etehtsea deleted the gh-3799-syswrite-block branch Nov 22, 2016
@etehtsea etehtsea restored the gh-3799-syswrite-block branch Nov 22, 2016
@headius
Copy link
Member

@headius headius commented Nov 22, 2016

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants