Message414034
> And just a question: I'm just curious about what happens if belonging tasks see the cancellation raised from their inner tasks. Sibling tasks should not be cancelled, and the outer task group should not be cancelled, unless the task group itself has requested cancellation. Could the new cancellation counter help this?
To achieve this by distinguishing cancellation from inner/outer tasks, TaskGroup._on_task_done() should be modified to skip setting _on_completed_fut because it should keep running. Swallowing exceptions in child tasks can be done without modifying TaskGroup, but this part requires changes of TaskGroup.
Another difference is the usage. Instead of relying on the async context manager interface, we would call "TaskGroup.shutdown()" separately from either directly in signal handlers or from cleanup methods of long-lived objects that have task groups as attributes.
And I also want to perform two-phase cancellation: instead of cancelling all tasks immediately as in current _abort(), have a configurable grace period until they have chances to complete and then cancel with additional timeout on cancellation itself to prevent hangs. |
|
Date |
User |
Action |
Args |
2022-02-25 19:08:02 | achimnol | set | recipients:
+ achimnol, gvanrossum, asvetlov, yselivanov, tinchester |
2022-02-25 19:08:02 | achimnol | set | messageid: <1645816082.04.0.928702722883.issue46843@roundup.psfhosted.org> |
2022-02-25 19:08:02 | achimnol | link | issue46843 messages |
2022-02-25 19:08:01 | achimnol | create | |
|