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 achimnol
Recipients achimnol, asvetlov, gvanrossum, yselivanov
Date 2022-02-25.07:03:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645772586.38.0.654475017437.issue46843@roundup.psfhosted.org>
In-reply-to
Content
Anoter case:

https://github.com/lablup/backend.ai-manager/pull/533
https://github.com/lablup/backend.ai-agent/pull/341

When shutting down the application, I'd like to explicitly cancel the shielded tasks, while keep them shielded before shutdown.

So I inserted `ptaskgroup.create_task()` inside `asyncio.shield()`, so that the tasks are not cancelled upon the cancellation of their callers but they get cancelled when the server shuts down.

This pattern is conveniently implemented with PersistentTaskGroup.
History
Date User Action Args
2022-02-25 07:03:06achimnolsetrecipients: + achimnol, gvanrossum, asvetlov, yselivanov
2022-02-25 07:03:06achimnolsetmessageid: <1645772586.38.0.654475017437.issue46843@roundup.psfhosted.org>
2022-02-25 07:03:06achimnollinkissue46843 messages
2022-02-25 07:03:06achimnolcreate