Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do KilledWorker exceptions mean in Dask?

Tags:

dask

My tasks are returning with KilledWorker exceptions when using Dask with the dask.distributed scheduler. What do these errors mean?

like image 797
MRocklin Avatar asked Oct 11 '17 15:10

MRocklin


1 Answers

This error is generated when the Dask scheduler no longer trusts your task, because it was present too often when workers died unexpectedly. It is designed to protect the cluster against tasks that kill workers, for example by segfaults or memory errors.

Whenever a worker dies unexpectedly the scheduler notes which tasks were running on that worker when it died. It retries those tasks on other workers but also marks them as suspicious. If the same task is present on several workers when they die then eventually the scheduler will give up on trying to retry this task, and instead marks it as failed with the exception KilledWorker.

Often this means that your task has some other issue. Perhaps it causes a segmentation fault or allocates too much memory. Perhaps it uses a library that is not threadsafe. Or perhaps it is just very unlucky. Regardless, you should inspect your worker logs to determine why your workers are failing. This is likely a bigger issue than your task failing.

You can control this behavior by modifying the following entry in your ~/.config/dask/distributed.yaml file.

allowed-failures: 3     # number of retries before a task is considered bad
like image 172
MRocklin Avatar answered Sep 30 '22 18:09

MRocklin