Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

flush outgoing heartbeats

Prevents mismatch between heartbeat timer and actual heartbeat send/recv events.

Applied in notebook and parallel.
  • Loading branch information...
commit d545c3b69e45ca79adda330e1bbfc9ac02f6a92b 1 parent 6bc0f53
@minrk authored
View
2  IPython/frontend/html/notebook/handlers.py
@@ -481,6 +481,8 @@ def ping_or_dead():
if self._kernel_alive:
self._kernel_alive = False
self.hb_stream.send(b'ping')
+ # flush stream to force immediate socket send
+ self.hb_stream.flush()
else:
try:
callback()
View
2  IPython/parallel/controller/heartmonitor.py
@@ -124,6 +124,8 @@ def beat(self):
# print self.on_probation, self.hearts
# self.log.debug("heartbeat::beat %.3f, %i beating hearts", self.lifetime, len(self.hearts))
self.pingstream.send(asbytes(str(self.lifetime)))
+ # flush stream to force immediate socket send
+ self.pingstream.flush()
def handle_new_heart(self, heart):
if self._new_handlers:
Please sign in to comment.
Something went wrong with that request. Please try again.