Hi, let me show this easy code:


def sleep_and_rescue
  begin
    sleep
  # Rescue ANY kind of exception.
  rescue Exception => e
    puts "exception rescued: #{e.class}: #{e.message}"
  ensure
    puts "ensure code..."
  end
end



t1 = Thread.new { sleep_and_rescue() }
t1.raise "DIE"

=>
exception rescued: RuntimeError: DIE
ensure code...

(OK, what I expected)



t2 = Thread.new { sleep_and_rescue() }
t2.kill

=>
#<Thread:0x000000010743c8 aborting>
ensure code...

(opss, rescue block not executed..., the same if I set
t2.abort_on_exception=true/false)


So, it means that the signal send by Thread#kill is not
"rescue--able", am I right?

-- 
Iaki Baz Castillo
<ibc / aliax.net>