Hello,
I have a running tasks that i submit to the cluster as a future:
def my_work():
operationA
operationB
return C
try:
f = client.submit(my_work)
wait(f, timeout=10, return_when="ALL_COMPLETED")
except TimeoutError:
f.cancel()
Suppose i submited my task and it is now at operationB and this operation takes too long and i want to cancel it. of course from client side i can just run f.cancel() as shown above but that would just kill the task and wouldn’t close it gracefully.
I am looking to implement something with signals that perhaps causes the future to raise an exception which intern causing operationB to stop and do other things to gracefully end the task completely.
is there a native way to achieve graceful task termination in dask?