-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
We ran into an issue recently where, using Timeout.timeout(), we had two nested timeouts set up. The outer one had a smaller timeout than the inner one, which we expected to trigger first, but it didn't. The inner one fired when it's timeout ran out, but the outer one never fired. Here's some code to reproduce the issue:
require 'timeout'
begin
Timeout.timeout(1) do
begin
Timeout.timeout(2) do
sleep(5)
end
rescue Timeout::Error
puts 'Timeout 2 triggered'
end
end
rescue Timeout::Error
puts 'Timeout 1 triggered'
endOn MRI, the outer timeout triggers after one second, so the inner one never fires. On JRuby (reproduced on 1.6.6 and 1.7.0-preview2), it's the other way around, so the error message will be "Timeout 2 triggered".
I guess given MRI's behaviour it could be assumed to be the expected behaviour in this case?
Let me know if there's any more information I can provide you with!
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels