Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.4
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Extensions, HelpWanted
-
Labels:None
-
Number of attachments :
Description
Basically, we call native accept() and that's non-interruptible. For other sockets, we use java-based infrastructure and do tricks with select there, but for Unix Socket, we go right to the native calls.
Looks like MRI (and Python for that matter) do clever tricks when they implement accept for sockets. They set the socket to O_NONBLOCK mode, and do select() until the socket is available, or something like that.
For Python, the code is: http://svn.python.org/projects/python/trunk/Modules/socketmodule.c (internal_select and friends).
Issue Links
- is related to
-
JRUBY-2223
UNUXServer#accept_nonblock hangs on Linux
-
Also, the following rubyspecs fail/hang due to this or similar issues:
UNIXServer#accept accepts what is written by the client
UNIXServer#accept can be interrupted by Thread#kill
UNIXServer#accept can be interrupted by Thread#rais
We also don't seed the thread status to "sleep" when we go to accept() blocking.