TCPServer#accept_nonblock blocks if it's already in #accept on another thread -----------------------------------------------------------------------------
Key: JRUBY-5230 URL: http://jira.codehaus.org/browse/JRUBY-5230 Project: JRuby Issue Type: Bug Components: Standard Library Affects Versions: JRuby 1.5.1, JRuby 1.6 Environment: ruby --version: jruby 1.6.0.dev (ruby 1.8.7 patchlevel 249) (2010-12-01 ea48d8d) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [linux-amd64-java] uname -a: Linux desk4 2.6.31-22-generic #63-Ubuntu SMP Thu Aug 19 00:23:50 UTC 2010 x86_64 GNU/Linux java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode) Reporter: Alex Young Assignee: Thomas E Enebo Priority: Minor Attachments: hanger.rb The following code hangs on jruby-1.5.1 and jruby-1.6.0-dev: require 'socket' serv = TCPServer.new(0) t = Thread.new{ serv.accept } sleep(0.5) p serv.accept_nonblock On MRI, it outputs: hanger.rb:6:in `accept_nonblock': Resource temporarily unavailable - accept(2) (Errno::EAGAIN) from hanger.rb:6 I've attached a test case which passes on MRI, but unfortunately it blocks on JRuby. For some reason, the timeout doesn't fire (or is ignored), and I don't know how to fix that. I don't believe this is a duplicate of JRUBY-2223, which is the closest reported bug I could find. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email