Skip to content

Commit 56552ed

Browse files
committed
handle error in cidfile removal more gracefully
1 parent e59538c commit 56552ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cwltool/job.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,11 @@ def docker_monitor(self, cidfile, tmpdir_prefix, cleanup_cidfile, process):
705705
time.sleep(1)
706706
if process.returncode is not None:
707707
if cleanup_cidfile:
708-
os.remove(cidfile)
709-
return
708+
try:
709+
os.remove(cidfile)
710+
except PermissionError as exc:
711+
_logger.warn("Ignored error cleaning up Docker cidfile: %s", exc)
712+
return
710713
try:
711714
with open(cidfile) as cidhandle:
712715
cid = cidhandle.readline().strip()

0 commit comments

Comments
 (0)