Ignore but log errors in Nanny.cleanup
@@ -16,7 +16,7 @@ from tornado import gen
from .comm import get_address_host
from .core import Server, rpc, RPCClosed, CommClosedError, coerce_to_address
from .metrics import disk_io_counters, net_io_counters, time
-from .utils import get_ip, ignoring, mp_context
+from .utils import get_ip, ignoring, mp_context, log_errors
from .worker import _ncores, run
@@ -254,6 +254,8 @@ class Nanny(Server):
return run(self, *args, **kwargs)
def cleanup(self):
+ with ignoring(Exception):
+ with log_errors():
if self.worker_dir and os.path.exists(self.worker_dir):
shutil.rmtree(self.worker_dir)
self.worker_dir = None
