-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
throwto
does not return in certain conditions
#25353
Comments
As for the "race condition", the result of yielding directly to an already scheduled/running Task is undefined. It works fine if you don't schedule it twice:
|
What is the recommended way to interrupt or cancel a running task from another task then? |
Would |
@time let sleep = Timer(5)
t = @schedule wait(sleep) # schedule a delay for 5 seconds
Base.sleep(1)
close(sleep) # cancel the sleep after 1 second
wait(t)
end |
In the actual situation that I have, the code being executed in the task is opaque to me. |
Then no, you can't interrupt it |
Too late for 1.2 for which this was originally marked, but nevertheless, it's a quick change, so might as well get it in now and have it be available in 1.3. Fixes #25353
Too late for 1.2 for which this was originally marked, but nevertheless, it's a quick change, so might as well get it in now and have it be available in 1.3. Fixes #25353
This is fine on the REPL, method returns after interrupting task:
But this never comes out, the target task should have exited though:
And this too, here the target task would not have exited:
When not in REPL,
throwto
does not return in all the above cases, but the behavior is slightly different. It still needs to be interrupted or killed. There also seems to be a race condition here which causes theWorkqueue inconsistency
error.The text was updated successfully, but these errors were encountered: