In the second job's callback, future.cancelled() == False, because the future hasn't resolved yet (I think?) and isn't aware that is_cancel_requested == True
This causes the third job to not get cancelled and the parent script hangs open indefinitely
Fix:
Disclaimer: This likely isn't the best fix but I just wanted to try an initial fix to see if it worked
I made the callback aware of is_cancel_requested, which correctly causes the the third job to get cancelled
The parent script correctly raises a CancelledError instead of hanging indefinitely
When using
civis.parallel.make_backend_factory
with joblib, cancelling a child job fails to cancel all the remaining child jobs and hangs indefinitelyTo reproduce:
git checkout 38b0e02
./examples/parallel_cancel.py
What's going wrong:
future.cancelled() == False
, because the future hasn't resolved yet (I think?) and isn't aware thatis_cancel_requested == True
Fix:
is_cancel_requested
, which correctly causes the the third job to get cancelled