Issue #595 has been updated by Benoit Daloze.


Could we clarify what is the desired behavior and what prevents it to be implemented?

There is a very old RubySpec about this and I would like to know whether this might be guaranteed in a future release or not.

----------------------------------------
Bug #595: Fiber ignores ensure clause
https://bugs.ruby-lang.org/issues/595#change-54429

* Author: Koichi Sasada
* Status: Assigned
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: -
* Backport: 
----------------------------------------
=begin
 Ruby プロセス終了時,Fiber が ensure を無視します.
 これは,前から直そうと思って手がついていなかった問題です.
 10月末までには直そうと思います.結構複雑なので,後回しにしていましました.
 
 fib = Fiber.new{
   begin
     Fiber.yield :ok
   ensure
     puts "should be print out"
   end
 }
 p fib.resume
=end


---Files--------------------------------
ensure_fiber.patch (2.12 KB)
ensure_fiber2.patch (7.57 KB)


-- 
https://bugs.ruby-lang.org/