-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.3.0 breaks Ruby 1.8 compatibility with Timeout call #87
Comments
On 10/16/2013 08:49 AM, David McCullars wrote:
Can you add some information about your exact Ruby version (output of Thanks, Guy |
We are using ree 1.8.7: ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.02 To reproduce I can do: [~] ➔ ruby -rtimeout -e "Timeout.timeout(1, StandardError.new) { sleep 10 }" However, that same line of code against 1.9.3p194 works: [~] ➔ ruby -rtimeout -e "Timeout.timeout(1, StandardError.new) { sleep 10 }" from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:68:in timeout' from -e:1:in '
|
I should also point out this works in REE 1.8.7: [~] ➔ ruby -rtimeout -e "Timeout.timeout(1, StandardError) { sleep 10 }" |
Here is another way of reproducing: in ree 1.8.7[~] ➔ ruby -e "p RUBY_VERSION; e = StandardError.new; begin; raise e; rescue StandardError; p :CAUGHT; end" [~] ➔ ruby -e "p RUBY_VERSION; e = StandardError.new; begin; raise e; rescue e; p :CAUGHT; end" in 1.9.3[~] ➔ ruby -e "p RUBY_VERSION; e = StandardError.new; begin; raise e; rescue StandardError; p :CAUGHT; end" [~] ➔ ruby -e "p RUBY_VERSION; e = StandardError.new; begin; raise e; rescue e; p :CAUGHT; end" |
REE specific. From an ancient CentOS system, standard Ruby install: ruby -v* Meanwhile, I will try to get REE installed somewhere, and experiment |
Bizarre. Well, after investigation, not REE specific. Even with a REE install Your example (which is totally not related to the gem) of: ruby -rtimeout -e "Timeout.timeout(1, StandardError.new) { sleep 10 }" is an entirely different story. For that example, I see:
Issue status: thinking. For the record my (Ubuntu) systems, built from Ruby repo, are:
Ref: https://gist.github.com/gmallard/7034128 On 10/17/2013 10:25 AM, Guy M. Allard wrote:
|
I certainly appreciate your thoroughness in looking at this -- thanks! The reason I posted that piece of seemingly unrelated code was line 87 of lib/stomp/client.rb. From 1.2.16 to 1.3, the line "Timeout.timeout(@start_timeout, Stomp::Error::StartTimeoutException.new(@start_timeout))" was added, and that uses the Timeout.timeout(n, some_exception_instance) syntax as opposed to Timeout.timeout(n, some_exception_class). I thought by pointing out the difference in those two syntaxes in REE 1.8 (at least for me) it might expedite your troubleshooting. |
Related to issue stompgem#87.
There is a fix for this on my personal github clone and a pull request You could clone my personal repo: https://github.com/gmallard/stomp.git and build a gem from the 'dev' branch if you want to test. |
Status: Closed If the issue persists please reopen this issue or create a new issue. |
With the addition of "Timeout.timeout(@start_timeout, Stomp::Error::StartTimeoutException.new(@start_timeout))" in lib/stomp/client.rb, Ruby 1.8 support is lost. The error received is "class or module required for rescue clause (TypeError)".
I did not see anywhere in the changelog where Ruby 1.8 support has officially been discontinued. If that was indeed intentional it would be really nice to add a note to the changelog so others won't fall into the same trap.
The text was updated successfully, but these errors were encountered: