mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
flush iopub before sending restarting/dead status messages
to ensure (approximately) that all messages from the stopped kernel are delivered before the dead/restarting message
This commit is contained in:
parent
1b69205530
commit
a53d2c8489
@ -456,6 +456,12 @@ class ZMQChannelsHandler(AuthenticatedZMQStreamHandler):
|
||||
self._close_future.set_result(None)
|
||||
|
||||
def _send_status_message(self, status):
|
||||
iopub = self.channels.get('iopub', None)
|
||||
if iopub and not iopub.closed():
|
||||
# flush IOPub before sending a restarting/dead status message
|
||||
# ensures proper ordering on the IOPub channel
|
||||
# that all messages from the stopped kernel have been delivered
|
||||
iopub.flush()
|
||||
msg = self.session.msg("status",
|
||||
{'execution_state': status}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user