Fix IO#syswrite. Fixes #3799 #4123

Merged
merged 1 commit into from Nov 22, 2016

Projects

None yet

2 participants

@etehtsea
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
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 etehtsea Bump jnr-enxio and add regression test
Fixes #3799
bfcec47
@etehtsea
Contributor
etehtsea commented Nov 16, 2016 edited

@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 from IO#syswrite should always block. Fixes #3799 to Fix IO#syswrite. Fixes #3799 Nov 16, 2016
@headius headius merged commit 723f2da into jruby:master Nov 22, 2016

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 etehtsea:gh-3799-syswrite-block branch Nov 22, 2016
@etehtsea etehtsea restored the etehtsea:gh-3799-syswrite-block branch Nov 22, 2016
@headius
Member
headius commented Nov 22, 2016

Thank you!

@etehtsea etehtsea deleted the etehtsea: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