Let a teardown's cancellation through, and reap the workers it leaves
Node stop paths cancelled their background task and then caught CancelledError around the await, which swallows a cancellation aimed at the caller — the trap Supervisor._cancel already documents. One shared Node._cancel_task now waits the way the supervisor does; mqtt's publisher and subscription and delay's cron call it. The api container also collected zombie python workers: orphaned when --reload replaces the process holding their handle, they reparent onto a PID 1 that reaps nothing but its own. `init: true` on the backend service.
This commit is contained in:
@@ -211,11 +211,7 @@ class DelayNode(Node):
|
||||
self._stop_cron.set()
|
||||
|
||||
if self._cron_task is not None:
|
||||
self._cron_task.cancel()
|
||||
try:
|
||||
await self._cron_task
|
||||
except asyncio.CancelledError:
|
||||
pass
|
||||
await self._cancel_task(self._cron_task)
|
||||
|
||||
self._cron_task = None
|
||||
self._stop_cron = None
|
||||
|
||||
Reference in New Issue
Block a user