From 7864db4f0a87c57a993117535f31365d151a25e7 Mon Sep 17 00:00:00 2001 From: Robbe Sneyders Date: Wed, 21 Feb 2024 13:54:30 +0100 Subject: [PATCH] Catch Dask client shutdown error --- src/fondant/component/component.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fondant/component/component.py b/src/fondant/component/component.py index 9da35dea..9f23afbd 100644 --- a/src/fondant/component/component.py +++ b/src/fondant/component/component.py @@ -1,4 +1,5 @@ """This module defines interfaces which components should implement to be executed by fondant.""" +import logging import os import typing as t from abc import abstractmethod @@ -57,7 +58,12 @@ def setup(self) -> t.Any: return Client(cluster) def teardown(self, client: t.Any) -> None: - return client.shutdown() + try: + client.shutdown() + except Exception: + msg = "Caught error while shutting down Client. Exiting anyway." + logging.exception(msg) + pass class DaskLoadComponent(DaskComponent):