From f8f1914895bec08cad0339a9935f5654ac0a7b4c 2012-02-02 23:25:19 From: MinRK Date: 2012-02-02 23:25:19 Subject: [PATCH] load header with engine id when engine dies in TaskScheduler This ensures that the metadata dict on the *Client* has the engine_uuid of the engine on which the task failed. It is identical to code elsewhere (Hub, Client) for identifying when engines die. --- diff --git a/IPython/parallel/controller/scheduler.py b/IPython/parallel/controller/scheduler.py index 7c2c13d..0cb4f0b 100644 --- a/IPython/parallel/controller/scheduler.py +++ b/IPython/parallel/controller/scheduler.py @@ -298,7 +298,13 @@ class TaskScheduler(SessionFactory): raise error.EngineError("Engine %r died while running task %r"%(engine, msg_id)) except: content = error.wrap_exception() - msg = self.session.msg('apply_reply', content, parent=parent, subheader={'status':'error'}) + # build fake header + header = dict( + status='error', + engine=engine, + date=datetime.now(), + ) + msg = self.session.msg('apply_reply', content, parent=parent, subheader=header) raw_reply = map(zmq.Message, self.session.serialize(msg, ident=idents)) # and dispatch it self.dispatch_result(raw_reply)