-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Cancellation blocks task_status.started
#2544
Comments
|
what i believe should happen:
N.B.: it seems to me that the expected runtime should be 2 s, not the 1 s that you wrote? what happened prior to #1696:
what happens currently:
|
The problem: when a task starts a shielded subtask, but is cancelled before the subtask re-parents itself, the cancellation isn't propagated until the subtask ends.
Consider this code:
What I expect to happen is that
tg.start
returns the value fromtask_status.started
, taskt
gets cancelled, this code takes one second to run.In my "real" usecase the subtask starts a database connection which must be (a) cached and (b) closed properly. Thus turning off the shield won't work. The cancellation in the last line of
main
is a stand-in for any kund of exception that might happen in the rest of the program.The text was updated successfully, but these errors were encountered: