I'm observing that sometimes a task submitted to a ProcessPool never completes, neither with success/failure nor with a timeout. After a lot of debugging the logs show the following sequence of events for the problematic task:
[05:57:55.093] WorkerManager.dispatch: task.id=287736
[05:57:55.100] stop_process: stopped pid=2667133
[05:57:55.138] PoolManager.process_next_message: message=Acknowledgement task.id=287736 worker_id=2667133
// here we're hung, with task id=287736 never completing;
// debug-dumping _pool_manager.task_manager.tasks shows Pebble thinks it's still running on the already-terminated worker:
{287736: Task(id=287736 worker_id=2667133)}
I believe what led to this situation is a race condition between the main process terminating the worker for some previous taskA that was cancel()ed, and the worker actually completing this taskA and moving on to acknowledging a new taskB before actually being killed - leaving the taskB in the limbo state.
I'm observing that sometimes a task submitted to a ProcessPool never completes, neither with success/failure nor with a timeout. After a lot of debugging the logs show the following sequence of events for the problematic task:
I believe what led to this situation is a race condition between the main process terminating the worker for some previous
taskAthat was cancel()ed, and the worker actually completing thistaskAand moving on to acknowledging a newtaskBbefore actually being killed - leaving thetaskBin the limbo state.