From 76d599a0ce4d08b8bf051d499acec633cd01b59c Mon Sep 17 00:00:00 2001 From: Peter Fackeldey Date: Fri, 1 Nov 2024 14:23:09 -0400 Subject: [PATCH] Update plugin.py: make callback async --- coffea_casa/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coffea_casa/plugin.py b/coffea_casa/plugin.py index ef966f18..0eeed2f6 100644 --- a/coffea_casa/plugin.py +++ b/coffea_casa/plugin.py @@ -10,6 +10,8 @@ from distributed.compatibility import PeriodicCallback from distributed.diagnostics.plugin import NannyPlugin, WorkerPlugin from dask.utils import tmpfile, parse_bytes +from distributed.utils import log_errors + logger = logging.getLogger(__name__) @@ -178,7 +180,8 @@ def setup(self, worker) -> None: worker.periodic_callbacks["coffea_casa_gc_collect"] = pc self.worker = worker - def _gc_collect(self) -> None: + @log_errors + async def _gc_collect(self) -> None: """ Trigger garbage collection if the process memory exceeds the threshold. """