Skip to content

Commit

Permalink
retry poll() on EINTR
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Jun 4, 2013
1 parent 7cd8762 commit baf23dd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pika/adapters/blocking_connection.py
Expand Up @@ -15,6 +15,7 @@
import socket
import time
import warnings
import errno

from pika import callback
from pika import channel
Expand Down Expand Up @@ -59,7 +60,14 @@ def ready(self):
"""
if self.poller:
events = self.poller.poll(self.poll_timeout)
while True:
try:
events = self.poller.poll(self.poll_timeout)
break
except select.error as e:
if e[0] != errno.EINTR:
raise

return True if events else False
else:
ready, unused_wri, unused_err = select.select([self.fd], [], [],
Expand Down

0 comments on commit baf23dd

Please sign in to comment.