You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ilya Maykov (JIRA)" <ji...@apache.org> on 2011/05/31 02:58:47 UTC

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

     [ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Maykov updated THRIFT-1187:
--------------------------------

    Description: 
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.

  was:
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:48:in `select'
/Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:48: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 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:48:in `select'
/Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:48: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 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:48:in `select'
/Users/ilyam/src/vendor/thrift-src/thrift-0.6.1-r19/lib/rb/lib/thrift/server/nonblocking_server.rb:48: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>'

Finished in 2.854211 seconds

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.


> nonblocking_server shutdown race under in 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
>            Priority: Minor
>
> 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