[ruby-core:117727] [Ruby master Bug#20459] Ractor.select() deadlock?

Issue #20459 has been reported by esad (Esad Hajdarevic). ---------------------------------------- Bug #20459: Ractor.select() deadlock? https://bugs.ruby-lang.org/issues/20459 * Author: esad (Esad Hajdarevic) * Status: Open * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin20] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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. -- https://bugs.ruby-lang.org/

Issue #20459 has been updated by luke-gru (Luke Gruber). 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. ---------------------------------------- Bug #20459: Ractor.select() deadlock? https://bugs.ruby-lang.org/issues/20459#change-108135 * Author: esad (Esad Hajdarevic) * Status: Open * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin20] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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. -- https://bugs.ruby-lang.org/

Issue #20459 has been updated by luke-gru (Luke Gruber). This can be closed as the related ticket is closed and the PR has been merged. Thanks! ---------------------------------------- Bug #20459: Ractor.select() deadlock? https://bugs.ruby-lang.org/issues/20459#change-108575 * Author: esad (Esad Hajdarevic) * Status: Open * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin20] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- 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. -- https://bugs.ruby-lang.org/
participants (2)
-
esad (Esad Hajdarevic)
-
luke-gru (Luke Gruber)