diff --git a/CHANGES b/CHANGES index 0845eee283..0480ad874a 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Upcoming release ###### [Full changelog](https://github.com/nipy/nipype/milestone/13) +* FIX: MultiProc mishandling crashes (https://github.com/nipy/nipype/pull/2301) * MAINT: Revise use of `subprocess.Popen` (https://github.com/nipy/nipype/pull/2289) * ENH: Memorize version checks (https://github.com/nipy/nipype/pull/2274, https://github.com/nipy/nipype/pull/2295) diff --git a/nipype/pipeline/plugins/multiproc.py b/nipype/pipeline/plugins/multiproc.py index 16bfb51a0d..b26d029518 100644 --- a/nipype/pipeline/plugins/multiproc.py +++ b/nipype/pipeline/plugins/multiproc.py @@ -238,8 +238,10 @@ def _send_procs_to_workers(self, updatehash=False, graph=None): num_subnodes = self.procs[jobid].num_subnodes() except Exception: traceback = format_exception(*sys.exc_info()) - self._report_crash(self.procs[jobid], traceback=traceback) - self._clean_queue(jobid, graph) + self._clean_queue( + jobid, graph, + result={'result': None, 'traceback': traceback} + ) self.proc_pending[jobid] = False continue if num_subnodes > 1: @@ -275,10 +277,13 @@ def _send_procs_to_workers(self, updatehash=False, graph=None): logger.debug('Running node %s on master thread', self.procs[jobid]) try: - self.procs[jobid].run() + self.procs[jobid].run(updatehash=updatehash) except Exception: traceback = format_exception(*sys.exc_info()) - self._report_crash(self.procs[jobid], traceback=traceback) + self._clean_queue( + jobid, graph, + result={'result': None, 'traceback': traceback} + ) # Release resources self._task_finished_cb(jobid)