When using futures on dask.distributed, is there a way to differentiate between pending futures that are currently being evaluated, and those that are still in the queue?
The reason is that I am submitting a large number of tasks (~8000) to a smaller set of workers (100), so not all tasks can be processed immediately. The tasks involve calling a third-party executable (via subprocess.check_output) which in some rare cases goes into an infinite loop.
Therefore, I would like to cancel futures to have been running for too long (using an arbitrary timeout). However there doesn't seem to be a way to tell whether a future has been in a pending state for a long time because computations take longer than usual, or simply because it had to wait for a worker to become available.
My setup involves a SGE cluster running a dask-scheduler and dask-worker job/job-array, respectively.
I tried setting a timeout directly in the submitted Python function, using @timeout_decorator.timeout(60, use_signals=False) from the timeout_decorator package, but got the following error:
"daemonic processes are not allowed to have children"
Any help would be much appreciated.