From: ko1@... Date: 2020-11-11T07:29:25+00:00 Subject: [ruby-core:100774] [Ruby master Bug#17310] Closed ractors should die Issue #17310 has been updated by ko1 (Koichi Sasada). At least, I merged (1) patch. `Ractor#kill` is not acceptable to avoid non-deterministic behavior like introduced by `Thread#kill`. ---- I'm not sure we need `Ractor#close_outgoing`. One possibility is to make a ractor detached (independent from any other ractors). But I have no idea how to use such detached ractors. Another possibility is notify the taking ractors to close earlier at exit phase. ```ruby Ractor.new do while msg = Ractor.recv Ractor.yield msg end close_outgoing # notify taking ractors before long_cleanup_code long_cleanup_code end ``` I'm also not sure we can provide `Ractor#close` which calls `close_incoming` and `close_outgoing`. They are different purpose, so I remove `Ractor#close` https://github.com/ruby/ruby/pull/3759 ---------------------------------------- Bug #17310: Closed ractors should die https://bugs.ruby-lang.org/issues/17310#change-88417 * 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: