Details

    • Number of attachments :
      0

      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

          Activity

          Hide
          Vladimir Sizikov added a comment -

          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.

          Show
          Vladimir Sizikov added a comment - 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.
          Hide
          Charles Oliver Nutter added a comment -

          This is fixed by our move to jnr-unixsocket, which is selectable. I've removed the tags around master@cd18b42.

          Show
          Charles Oliver Nutter added a comment - This is fixed by our move to jnr-unixsocket, which is selectable. I've removed the tags around master@cd18b42.

            People

            • Assignee:
              Charles Oliver Nutter
              Reporter:
              Vladimir Sizikov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: