Skip to content

Commit eb4809e

Browse files
authored
Merge pull request #2436 from mgxd/fix/bpp
FIX: Add some clarity to BrokenProcessPool failures
2 parents 70982b6 + be64d9f commit eb4809e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

fmriprep/cli/run.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ def main():
104104
try:
105105
fmriprep_wf.run(**config.nipype.get_plugin())
106106
except Exception as e:
107+
msg = "Issue encountered while running fMRIPrep."
108+
from concurrent.futures.process import BrokenProcessPool
109+
if isinstance(e, BrokenProcessPool):
110+
msg += " Usually, this is a result of insufficent memory."
111+
if config.environment.exec_env in ("docker", "fmriprep-docker"):
112+
msg += (
113+
" Ensure Docker has sufficent resources available "
114+
"(https://docs.docker.com/docker-for-mac/#resources)"
115+
)
116+
config.loggers.workflow.error(msg)
107117
if not config.execution.notrack:
108118
from ..utils.sentry import process_crashfile
109119

@@ -121,7 +131,7 @@ def main():
121131
if "Workflow did not execute cleanly" not in str(e):
122132
sentry_sdk.capture_exception(e)
123133
config.loggers.workflow.critical("fMRIPrep failed: %s", e)
124-
raise
134+
raise RuntimeError(msg) from e
125135
else:
126136
config.loggers.workflow.log(25, "fMRIPrep finished successfully!")
127137
if not config.execution.notrack:

0 commit comments

Comments
 (0)