majek / puka

Puka - the opinionated RabbitMQ client
https://github.com/majek/puka
Other
182 stars 34 forks source link

puka should ignore WSAEWOULDBLOCK on windows #40

Closed schmir closed 11 years ago

schmir commented 11 years ago

I just got the following error on windows:

  File "c:\users\ralf\home\fscrawler\_fscrawler\thread_helper.py", line 13, in run
    res = func(*args, **kwargs)
  File "c:\users\ralf\home\fscrawler\_fscrawler\connector.py", line 93, in

    call_methods(client, cmd_lst)
  File "c:\users\ralf\home\fscrawler\_fscrawler\connector.py", line 51, in

    client.wait_for_all(promises)
  File "c:\users\ralf\home\.buildout\cache-eggs\puka-0.0.6.2-py2.7.egg\puka\connection.py", line 270, in wait_for_all
    self.wait(promise, raise_errors=raise_errors)
  File "c:\users\ralf\home\.buildout\cache-eggs\puka-0.0.6.2-py2.7.egg\puka\connection.py", line 233, in wait
    self.on_write()
  File "c:\users\ralf\home\.buildout\cache-eggs\puka-0.0.6.2-py2.7.egg\puka\connection.py", line 193, in on_write
    r = self.sd.send(self.send_buf.read(128*1024))
socket.error: [Errno 10035] A non-blocking socket operation could not be completed immediately

10035 is WSAEWOULDBLOCK

http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668%28v=vs.85%29.aspx has the following to say on that:

Resource temporarily unavailable.

This error is returned from operations on nonblocking sockets that
cannot be completed immediately, for example recv when no data is
queued to be read from the socket. It is a nonfatal error, and the
operation should be retried later. It is normal for WSAEWOULDBLOCK to
be reported as the result from calling connect on a nonblocking
SOCK_STREAM socket, since some time must elapse for the connection to
be established.
majek commented 11 years ago

should we close this?

schmir commented 11 years ago

yes.