-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task hangs during stop if there are more than two sub tasks (?) #158
Comments
Thanks, I'll check it. |
I was hoping this was fixed together with #137 but it's still happening with Ruby 3.2-preview2:
The process should terminate after the first ˆC, but hangs instead. The second one calls My Gemfile (repos checked out at current master/main): gem 'async', path: '../async'
gem 'io-event', path: '../io-event'
gem 'timers', path: '../timers' |
Thanks for the update, I'll investigate. |
I could reproduce the issue. I'll investigate more. |
|
Any updates? |
For some odd reason, I could not reproduce the issue any more. Do you mind checking? I'm sure it's something wrong on my end, I have a local branch with some work to deal with this, but have not pushed it yet. |
@ioquatix Yes, it's still happening with v2.5.1 on Ruby 3.2.2:
|
Okay great, thanks, I'll check what's going on. |
Here is a smaller repro: #!/usr/bin/env ruby
require_relative 'lib/async'
Async(annotation: "Top") do |task|
task.async(annotation: "Stopper") do
sleep 0.1
puts "Stopping parent..."
task.stop
end
task.async(annotation: "Sleeper #1") do
puts "sleeping #1"
sleep
end
# NOTE: Hangs only if this second task is added
task.async(annotation: "Sleeper #2") do
puts "sleeping #2"
sleep
end
end
puts 'Done' I understand the problem and am working on a fix. |
@ioquatix Thank you for the fix. |
I'm on Ruby 3.1.1 and Async 2.0.1, Ubuntu 20.04. The following script hangs after the first Ctrl+C, but only if both sleeping tasks are active:
Maybe related to #137 but it also hangs with all
puts
commented out.The text was updated successfully, but these errors were encountered: