Skip to content

Commit

Permalink
Merge pull request #3759 from minrk/flush-iopub
Browse files Browse the repository at this point in the history
flush iopub before sending restarting/dead status messages
  • Loading branch information
blink1073 authored Aug 13, 2018
2 parents eed1caf + a53d2c8 commit 34baae5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions notebook/services/kernels/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ def on_close(self):
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}
)
Expand Down

0 comments on commit 34baae5

Please sign in to comment.