This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tinchester
Recipients ajoino, alex.gronholm, asvetlov, gvanrossum, iritkatriel, jab, njs, tinchester, yselivanov
Date 2022-02-16.23:05:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645052733.03.0.349779492622.issue46771@roundup.psfhosted.org>
In-reply-to
Content
The use of the cancel message is a hack, yeah. But it's what I had to work with. We could introduce a new, proper cancellation context to Tasks instead, which could be attached to the CancelError when it's raised.

On the topic of multiple cancellations being applied to a task before it gets to run: could we just treat the cancellation context as a stack, and when the task gets to run, we throw them all in, one by one? Other options would involve somehow figuring out what the highest priority cancellation context is, or combining all the cancellation contexts into the CancelError somehow.

On the topic of a task getting to run at least once before being cancelled: sure, I guess. I've personally never needed this but I can see how it'd be useful. Either have a flag on the Task instance or build that logic into the cancellation context handling?
History
Date User Action Args
2022-02-16 23:05:33tinchestersetrecipients: + tinchester, gvanrossum, njs, jab, asvetlov, alex.gronholm, yselivanov, iritkatriel, ajoino
2022-02-16 23:05:33tinchestersetmessageid: <1645052733.03.0.349779492622.issue46771@roundup.psfhosted.org>
2022-02-16 23:05:33tinchesterlinkissue46771 messages
2022-02-16 23:05:32tinchestercreate