Project

General

Profile

Actions

Bug #20459

closed

Ractor.select() deadlock?

Added by esad (Esad Hajdarevic) 8 months ago. Updated 7 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin20]
[ruby-core:117727]

Description

When I run this script

echo = Ractor.new { Ractor.receive }
Thread.new { puts Ractor.select(echo).inspect }
sleep 0.1
echo.send "test"

the script never terminates. If I change thread body to

Thread.new { puts echo.take.inspect }

or introduce a small delay before #select like:

Thread.new { sleep 1; puts Ractor.select(echo).inspect }

then it works/terminates.

Updated by luke-gru (Luke Gruber) 8 months ago

I just took a look at this and it's related to this ticket: https://redmine.ruby-lang.org/issues/20168. The linked pull request that fixes that issue also fixes this one.

Updated by luke-gru (Luke Gruber) 7 months ago

This can be closed as the related ticket is closed and the PR has been merged. Thanks!

Actions #3

Updated by jeremyevans0 (Jeremy Evans) 7 months ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0