You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2011/06/01 21:09:47 UTC

[jira] [Commented] (THRIFT-1187) nonblocking_server shutdown race under Ruby 1.9

    [ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042368#comment-13042368 ] 

Hudson commented on THRIFT-1187:
--------------------------------

Integrated in Thrift #152 (See [https://builds.apache.org/hudson/job/Thrift/152/])
    THRIFT-1187. rb: nonblocking_server shutdown race under Ruby 1.9

This patch fixes a shutdown error that occurs under ruby 1.9.2

Patch: Ilya Maykov

bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1130242
Files : 
* /thrift/trunk/lib/rb/lib/thrift/server/nonblocking_server.rb


> nonblocking_server shutdown race under Ruby 1.9
> -----------------------------------------------
>
>                 Key: THRIFT-1187
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1187
>             Project: Thrift
>          Issue Type: Bug
>          Components: Ruby - Library
>    Affects Versions: 0.6.1
>         Environment: OS X Darwin 10.6 i686 + Ruby 1.9.2-p180
>            Reporter: Ilya Maykov
>            Assignee: Ilya Maykov
>            Priority: Minor
>             Fix For: 0.7
>
>         Attachments: patch-THRIFT-1187.txt
>
>
> While testing some changes today I noticed that nonblocking_server tests pass for me under Ruby 1.8.7 but fail under Ruby 1.9.2. Here are the test failures:
> ...
> 1)
> Errno::EBADF in 'Thrift::NonblockingServer should shut down when asked'
> Bad file descriptor
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `select'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `block in serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `loop'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/spec/nonblocking_server_spec.rb:118:in `block (3 levels) in <class:ThriftNonblockingServerSpec>'
> 2)
> Errno::EBADF in 'Thrift::NonblockingServer should continue processing active messages when shutting down'
> Bad file descriptor
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `select'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `block in serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `loop'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/spec/nonblocking_server_spec.rb:118:in `block (3 levels) in <class:ThriftNonblockingServerSpec>'
> 3)
> Errno::EBADF in 'Thrift::NonblockingServer should kill active messages when they don't expire while shutting down'
> Bad file descriptor
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `select'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `block in serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `loop'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/spec/nonblocking_server_spec.rb:118:in `block (3 levels) in <class:ThriftNonblockingServerSpec>'
> 4)
> Errno::EBADF in 'Thrift::NonblockingServer should allow shutting down in response to a message'
> Bad file descriptor
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `select'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:47:in `block in serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `loop'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:45:in `serve'
> /Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/spec/nonblocking_server_spec.rb:118:in `block (3 levels) in <class:ThriftNonblockingServerSpec>'
> ...
> I *think* that either the behavior of select() changed between 1.8.7 and 1.9.2, or the different threading model in 1.9.2 is tickling a timing bug. In any case, shutting down the server causes the @server_transport socket to be closed, which raises Errno::EBADF in the main loop inside the serve() method. Probably not a big deal because the server is shutting down anyway, but should be fixed so the tests pass.
> Will attach patch shortly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira