Skip to content

Commit cfb5aba

Browse files
authored
Merge pull request #2767 from mgxd/enh/slurmpoll
enh: account for timeouts during job status checks
2 parents ce1ef65 + 6cc6fcb commit cfb5aba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nipype/pipeline/plugins/slurm.py

+8
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ def _is_pending(self, taskid):
7070
terminal_output='allatonce').run()
7171
return res.runtime.stdout.find(str(taskid)) > -1
7272
except RuntimeError as e:
73+
if any(ss in str(e) for ss
74+
in ['Socket timed out', 'not available at the moment']):
75+
# do not raise error and allow recheck
76+
logger.warning(
77+
"SLURM timeout encountered while checking job status,"
78+
" treating job %d as pending", taskid
79+
)
80+
return True
7381
if 'Invalid job id' not in str(e):
7482
raise(e)
7583
return False

0 commit comments

Comments
 (0)