uncaught EAGAIN in recv()

Jeremy Hylton jeremy@z...
Fri, 10 Aug 2001 10:46:32 -0400 (EDT)


We have used asyncore to implement ZEO, a client-server subsystem for
the ZODB object database. I think the details of the application are
unimportant, but you can find more info at
http://www.zope.org/Wikis/ZODB/

One of our users has a problem with an uncaught socket error on
recv(). Logging output here:

Logging [ZEO]: uncaptured python exception, closing 
channel <asyncRPC connected at 8241d30> (socket.error:(11, 'Resource 
temporarily unavailable') 
[/usr/local/stow/python21_debug/lib/python2.1/asyncore.py|poll|95] 
[/usr/local/stow/python21_debug/lib/python2.1/asyncore.py|handle_read_event|383] 
[/home/jheintz/lib/python/ZEO/smac.py|handle_read|119] 
[/usr/local/stow/python21_debug/lib/python2.1/asyncore.py|recv|349])

This is certainly a standard error that recv() can raise, although I
am surprised to see it after poll() says that the socket is ready to
read. The Linux man page for recv() says:

EAGAIN The socket is marked non-blocking and the receive
operation would block, or a receive timeout had
been set and the timeout expired before data was
received.

It seems to me that asyncore should be prepared to catch this error on
recv(), but it does not. Is this any oversight? Would it make sense
to fix in the Python source tree?

Jeremy