File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,16 @@ async def __get_loops(self):
255255 except Exception as e :
256256 logging .exception (f"{ self .identity !r} : failed with unhandled exception:\n { e } " )
257257
258- await self ._connector_external .send (WorkerDisconnectNotification .new_msg (self .identity ))
258+ try :
259+ await self ._connector_external .send (WorkerDisconnectNotification .new_msg (self .identity ))
260+ except ymq .YMQException as e :
261+
262+ # this means that the scheduler shut down before we could send our notification
263+ # we don't consider this to be an error
264+ if e .code == ymq .ErrorCode .ConnectorSocketClosedByRemoteEnd :
265+ pass
266+ else :
267+ raise
259268
260269 self ._connector_external .destroy ()
261270 self ._processor_manager .destroy ("quit" )
@@ -272,4 +281,5 @@ def __register_signal(self):
272281 self ._loop .add_signal_handler (signal .SIGINT , self .__destroy )
273282
274283 def __destroy (self ):
284+ print ("DESTROYING WORKER!!!" )
275285 self ._task .cancel ()
You can’t perform that action at this time.
0 commit comments