From: "zverok (Victor Shepelev) via ruby-core" Date: 2023-12-23T21:15:27+00:00 Subject: [ruby-core:115881] [Ruby master Bug#20082] Killing fibers across threads: unexpected exception Issue #20082 has been reported by zverok (Victor Shepelev). ---------------------------------------- Bug #20082: Killing fibers across threads: unexpected exception https://bugs.ruby-lang.org/issues/20082 * Author: zverok (Victor Shepelev) * Status: Open * Priority: Normal * Assignee: ioquatix (Samuel Williams) * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- For providing the example in a changelog, I tried to imitate killing fibers belonging to other threads. Documentation [claims](https://docs.ruby-lang.org/en/master/Fiber.html#method-i-kill) > Raises FiberError if called on a fiber belonging to another thread. So, I created this artificial example to check how it works: ```ruby fibers = [] Thread.new { f = Fiber.new { (1..).each { sleep(0.1) } } fibers << f f.resume } sleep(0.1) # to make sure the thread has started fibers.last.kill ``` The example indeed fails with `FiberError`, but the error message is confusing: ``` in `kill': attempt to resume a resumed fiber (double resume) (FiberError) ``` Is this an expected message for such case? Or am I misunderstanding something? -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/