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:56:47 UTC
[jira] [Created] (THRIFT-1187) nonblocking_server shutdown race
under in Ruby 1.9
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: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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (THRIFT-1187) nonblocking_server shutdown race
under in Ruby 1.9
Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Updated] (THRIFT-1187) nonblocking_server shutdown race
under in Ruby 1.9
Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Maykov updated THRIFT-1187:
--------------------------------
Attachment: (was: patch-THRIFT-1187.txt)
> 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
> 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
[jira] [Commented] (THRIFT-1187) nonblocking_server shutdown race
under Ruby 1.9
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Updated] (THRIFT-1187) nonblocking_server shutdown race
under in Ruby 1.9
Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Maykov updated THRIFT-1187:
--------------------------------
Attachment: patch-THRIFT-1187.txt
Patch attached. Paths are funky again because it's against my own git repo, sorry.
> 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
> 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
[jira] [Updated] (THRIFT-1187) nonblocking_server shutdown race
under in Ruby 1.9
Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Maykov updated THRIFT-1187:
--------------------------------
Attachment: patch-THRIFT-1187.txt
Uploading again, fixed commend.
> 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
> 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
[jira] [Updated] (THRIFT-1187) nonblocking_server shutdown race
under Ruby 1.9
Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ilya Maykov updated THRIFT-1187:
--------------------------------
Summary: nonblocking_server shutdown race under Ruby 1.9 (was: nonblocking_server shutdown race under in Ruby 1.9)
> 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
> Priority: Minor
> 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
[jira] [Commented] (THRIFT-1187) nonblocking_server shutdown race
under Ruby 1.9
Posted by "Ilya Maykov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041421#comment-13041421 ]
Ilya Maykov commented on THRIFT-1187:
-------------------------------------
To repro the original bug:
1) rvm use 1.9.2 (assuming you have rvm set up)
1) download and build thrift-0.6.1
2) cd thrift-0.6.1/lib/rb
3) rake
> 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
> Priority: Minor
> 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
[jira] [Closed] (THRIFT-1187) nonblocking_server shutdown race
under Ruby 1.9
Posted by "Bryan Duxbury (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury closed THRIFT-1187.
---------------------------------
Resolution: Fixed
Fix Version/s: 0.7
Assignee: Ilya Maykov
I just committed this patch.
> 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