Skip to content

Commit

Permalink
Only log error if deleting directory really failed
Browse files Browse the repository at this point in the history
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'`.
  • Loading branch information
mvdbeek committed May 28, 2024
1 parent 02c6e7f commit 7ac9898
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/galaxy/objectstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7ac9898

Please sign in to comment.