From 7ac98987a5feadcd4b0fbf94c51e7a477aceb92e Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Tue, 28 May 2024 09:21:04 +0200 Subject: [PATCH] Only log error if deleting directory really failed If we can't look up the directory it's safe to assume it really is gone. Fixes `None delete error [Errno 39] Directory not empty: 'outputs_populated'`. --- lib/galaxy/objectstore/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/objectstore/__init__.py b/lib/galaxy/objectstore/__init__.py index a8b796122388..8965f3a7c763 100644 --- a/lib/galaxy/objectstore/__init__.py +++ b/lib/galaxy/objectstore/__init__.py @@ -851,7 +851,12 @@ def _delete(self, obj, entire_dir=False, **kwargs): except OSError as ex: # Likely a race condition in which we delete the job working directory # and another process writes files into that directory. - log.critical(f"{self.__get_filename(obj, **kwargs)} delete error {ex}", exc_info=True) + # If the path doesn't exist anymore, another rmtree call was successful. + path = self.__get_filename(obj, **kwargs) + if path is None: + return True + else: + log.critical(f"{path} delete error {ex}", exc_info=True) return False def _get_data(self, obj, start=0, count=-1, **kwargs):