Skip to content

Commit

Permalink
Suppress the 'Interrupted system call' ZMQError
Browse files Browse the repository at this point in the history
  • Loading branch information
Elmo Todurov committed Sep 19, 2013
1 parent 2a114bb commit 4b18a67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spinoff/remoting/hub.py
@@ -1,5 +1,6 @@
from __future__ import print_function

import errno
import time
import socket
import struct
Expand Down Expand Up @@ -136,7 +137,12 @@ def _listen(self, sock, on_sock):
recv, t, execute, message_received, ping_received, sig_disconnect_received = (
sock.recv_multipart, time.time, self._execute, self._logic.message_received, self._logic.ping_received, self._logic.sig_disconnect_received)
while True:
data = recv()
try:
data = recv()
except zmq.ZMQError as e:
if e.errno != errno.EINTR: # Sometimes "Interrupted system call" happens on Linux. Nobody knows which signal is interrupting it.
raise
continue
try:
sender_nid, msg_bytes = data
except ValueError:
Expand Down

0 comments on commit 4b18a67

Please sign in to comment.