Stopping a workflow: sometimes causes RuntimeError instead of WorkflowException
Stopping a workflow does two things: https://gitlab.esrf.fr/workflow/pypushflow/-/blob/main/src/pypushflow/Workflow.py#L155
- set
stop_exception
- close the pool
When executing PythonActor
we check stop_exception
before using a pool https://gitlab.esrf.fr/workflow/pypushflow/-/blob/main/src/pypushflow/PythonActor.py#L53. However this introduces a race condition because the workflow can be stopped between passing the check and using the pool