Skip to content

Commit

Permalink
Merge pull request #443 from minrk/flush-control
Browse files Browse the repository at this point in the history
ensure control stream is flushed before processing shell messages
  • Loading branch information
blink1073 authored Sep 27, 2019
2 parents d283077 + 2ae5a81 commit f0c72af
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ def should_handle(self, stream, msg, idents):
@gen.coroutine
def dispatch_shell(self, stream, msg):
"""dispatch shell requests"""
# flush control requests first
if self.control_stream:
self.control_stream.flush()

idents, msg = self.session.feed_identities(msg, copy=False)
try:
msg = self.session.deserialize(msg, content=True, copy=False)
Expand Down Expand Up @@ -373,6 +369,9 @@ def dispatch_queue(self):
"""

while True:
# ensure control stream is flushed before processing shell messages
if self.control_stream:
self.control_stream.flush()
# receive the next message and handle it
try:
yield self.process_one()
Expand Down

0 comments on commit f0c72af

Please sign in to comment.