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

waitReadable should block #3929

Merged
merged 2 commits into from May 26, 2016

Conversation

Projects
None yet
1 participant
@headius
Member

headius commented May 26, 2016

This attempts to fix some sporadic readpartial tests and specs in the suite, specifically in this case a failure in MRI's test_readpartial.rb in test_open_pipe. Our old old would never properly wait for the pipe to become readable and would keep spinning and trying to do nonblocking reads followed by waitReadable that never waited. As a result we could have interrupts happen at unexpected times, leaving IO in a weird state that probably caused sporadic close errors like in https://travis-ci.org/jruby/jruby/jobs/132959357

headius added some commits May 26, 2016

wait_readable in MRI appears to always block, so we should too.
This may have been an oversight; 0 means don't wait on the select
at all, but I may have been confused thinking it meant wait
forever. Doing waitReadable but not waiting for it to be readable
seems obviously wrong.

@headius headius added this to the JRuby 9.1.3.0 milestone May 26, 2016

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius May 26, 2016

Member

Another example, from https://travis-ci.org/jruby/jruby/jobs/131738145

     [exec]   1) Error:
     [exec] TestReadPartial#test_with_stdio:
     [exec] Errno::EBADF: Bad file descriptor - No message available
     [exec]     org/jruby/RubyIO.java:1955:in `close'
     [exec]     /home/travis/build/jruby/jruby/test/mri/ruby/test_readpartial.rb:14:in `make_pipe'
     [exec]     /home/travis/build/jruby/jruby/test/mri/ruby/test_readpartial.rb:26:in `pipe'
     [exec]     /home/travis/build/jruby/jruby/test/mri/ruby/test_readpartial.rb:61:in `test_with_stdio'
Member

headius commented May 26, 2016

Another example, from https://travis-ci.org/jruby/jruby/jobs/131738145

     [exec]   1) Error:
     [exec] TestReadPartial#test_with_stdio:
     [exec] Errno::EBADF: Bad file descriptor - No message available
     [exec]     org/jruby/RubyIO.java:1955:in `close'
     [exec]     /home/travis/build/jruby/jruby/test/mri/ruby/test_readpartial.rb:14:in `make_pipe'
     [exec]     /home/travis/build/jruby/jruby/test/mri/ruby/test_readpartial.rb:26:in `pipe'
     [exec]     /home/travis/build/jruby/jruby/test/mri/ruby/test_readpartial.rb:61:in `test_with_stdio'

@headius headius merged commit a65ad3a into jruby:master May 26, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@headius headius deleted the headius:waitreadable_blocking branch May 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment