Project

General

Profile

Actions

Bug #18375

closed

Timeout.timeout(sec, klass: MyExceptionClass) can not retry correctly.

Added by zw963 (Wei Zheng) over 2 years ago. Updated over 2 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:106358]

Description

Following is a example for describe this issue.

class DelayError < Exception
end

Timeout.timeout(2, DelayError) do |arg|
  puts 'start'
  sleep 10
rescue DelayError
  puts '*'*10
  retry
end

Will output

start
**********
start

What i expected is:

start
**********
start
**********
start
**********
...

Basically, what i expected equivalent is:

begin
  Timeout.timeout(2) do |arg|
    puts 'start'
    sleep 10
  end
rescue TimeoutError
  puts '*'*10
  retry
end
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0