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
File::write uses nonblocking IO when MRI uses blocking #5663
Comments
Huh, that's weird. Our pty library is FFI-based and lives in lib/ruby/stdlib. Maybe you can have a look there and see if something obvious is going on (like setting the IO streams O_NONBLOCK or something). https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/pty.rb |
After too much
Should be GETFD/SETFD according to man pages. However, I also found that
|
As the comment suggests, the hack predates |
Use close_on_exec method instead of using fcntl calls for pty. Fixes #5663
Environment
Expected Behavior
MRI waits if nobody is reading the other side of a pty pair:
Actual Behavior
However JRuby appears to use non-blocking IO and thus throws an exception:
It took me a bit to figure out that the errno was
EAGAIN (Resource temporarily unavailable)
(not sure why that wasn't in the exception message, another issue?)I found this as the surprise exception causes a compatibility issue with Pry in a Pty to exit on large output (think ENV inspection, ~12k on my machine) in JRuby, but not under MRI as MRI never throws here.
The text was updated successfully, but these errors were encountered: