RichardC
unread,Nov 8, 2008, 3:28:23 PM11/8/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cherrypy-devel
I think I've found a bug in wsgiserver. I can't figure out how to get
an account in Trac so I can create a ticket, so here are the details.
I've been working with CherryPy for a few months under linux and have
seen this maybe two or three times. So it's extremely intermittent.
File "/home/richardc/projects/market/python/lib/python2.5/site-
packages/cherrypy/wsgiserver/__init__.py", line 968, in communicate
req.parse_request()
File "/home/richardc/projects/market/python/lib/python2.5/site-
packages/cherrypy/wsgiserver/__init__.py", line 304, in parse_request
self._parse_request()
File "/home/richardc/projects/market/python/lib/python2.5/site-
packages/cherrypy/wsgiserver/__init__.py", line 317, in _parse_request
request_line = self.rfile.readline()
File "/home/richardc/projects/market/python/lib/python2.5/site-
packages/cherrypy/wsgiserver/__init__.py", line 212, in readline
data = self.rfile.readline(256)
File "/home/richardc/projects/market/python/lib/python2.5/site-
packages/cherrypy/wsgiserver/__init__.py", line 822, in readline
data = self.recv(self._rbufsize)
File "/home/richardc/projects/market/python/lib/python2.5/site-
packages/cherrypy/wsgiserver/__init__.py", line 724, in recv
return self._sock.recv(size)
error: (4, 'Interrupted system call')
The recv function loops when an exception with an errno in
sock_errors_nonblocking is raised:
def recv(self, size):
while True:
try:
return self._sock.recv(size)
except socket.error, e:
if e.args[0] not in socket_errors_nonblocking:
raise
However socket_errors_nonblocking does not contain EINTR which my
stacktrace shows occurs from time to time.
socket_errors_nonblocking = plat_specific_errors(
'EAGAIN', 'EWOULDBLOCK', 'WSAEWOULDBLOCK')
sock_errors_nonblocking should probably be initialised as:
socket_errors_nonblocking = plat_specific_errors(
'EAGAIN', 'EWOULDBLOCK', 'WSAEWOULDBLOCK', 'EINTR', 'WSAEINTR')
Something similar may need to be done for sending data as well.