From: ko1@... Date: 2020-11-10T08:12:44+00:00 Subject: [ruby-core:100758] [Ruby master Bug#17310] Closed ractors should die Issue #17310 has been updated by ko1 (Koichi Sasada). Thank you. Flow: 1. close outgoing port 2. exit the block and try to yield the result 3. outgoing port is closed 4. raise an exception (ClosedError) 5. catch the exception, and try to yield the exception 6. goto 3 There are several options: (1) we need to ignore the last yield if outgoing port is closed. (2) remove `close_outgoing` I have no strong motivation to provide `Ractor#close_outgoing` and `Ractor#close` by other ractors. I believe terminated ractors should close their own ports (incoming port and outgoing port) to tell its termination to other taking ractors. Also I believe `Ractor#close_incoming` is needed to tell there is no more messages for the ractor. However, I don't have strong opinion about `close_outgoing`. This method is provided because it can be implemented. So (2) is one idea, I guess. ---------------------------------------- Bug #17310: Closed ractors should die https://bugs.ruby-lang.org/issues/17310#change-88403 * Author: marcandre (Marc-Andre Lafortune) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.0.0dev (2020-11-07T21:47:45Z master 2f12af42f7) [x86_64-darwin18] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- While backporting Ractors, I found this issue: ```ruby 10.times { Ractor.new { sleep(0.1) } } sleep(1) puts Ractor.count # => 1, ok # but: 10.times { Ractor.new { sleep(0.1) }.close } sleep(1) Ractor.count # => 11, should be 1 ``` -- https://bugs.ruby-lang.org/ Unsubscribe: