Actions
Bug #17366
closedRactor odd issue with timeout + receive + sleep + take
Description
I believe the following behavior is incorrect:
ruby -r timeout -e 'r = Ractor.new { Timeout.timeout(0.1) { sleep(1) } rescue :timeout }; p r.take'
# => :timeout (ok)
ruby -r timeout -e 'r = Ractor.new { Timeout.timeout(0.1) { sleep(1) } rescue :timeout }; sleep(0.2); p r.take'
# => :timeout (ok)
ruby -r timeout -e 'r = Ractor.new { Timeout.timeout(0.1) { Ractor.receive } rescue :timeout }; p r.take'
# => :timeout (ok)
ruby -r timeout -e 'r = Ractor.new { Timeout.timeout(0.1) { Ractor.receive } rescue :timeout }; sleep(0.2); p r.take'
<internal:ractor>:130:in `take': The outgoing-port is already closed (Ractor::ClosedError) # => not ok
Updated by ko1 (Koichi Sasada) over 3 years ago
I can confirm with it:
r = Ractor.new {
begin
pth = Thread.current
Thread.new{ pth.kill }.join
rescue => e
p e
end
}
p r.take
Updated by ko1 (Koichi Sasada) over 3 years ago
- Status changed from Open to Closed
Actions
Like0
Like0Like0