Ticket #29 (new defect)

Opened 4 years ago

Last modified 3 years ago

Threaded server sometimes wrongly times out long running responses

Reported by: trac Assigned to: asaddi
Priority: major Milestone:
Component: flup.server Version: 1.0
Keywords: Cc:

Description

I have no idea how to reproduce this, but it's been a huge issue for me so I'll try my best to explain:

I have an application that serves long running HTTP responses via generators (hundreds of megabytes), and for certain clients, flup times out the response for them for no obvious reason. I've switched to using mod_wsgi for this particular application, and it doesn't have the problem at all.

Here's what the traceback looked like from my Apache error log:

 Traceback (most recent call last):
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 558, in run
     protocolStatus, appStatus = self.server.handler(self)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 1120, in handler
     write(data)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 1085, in write
     req.stdout.write(data)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 315, in write
     self._write(data)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 299, in _write
     self._conn.writeRecord(rec)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 697, in writeRecord
     rec.write(self._sock)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 530, in write
     self._sendall(sock, header)
   File "/usr/local/lib/python2.5/site-packages/flup-1.0-py2.5.egg/flup/server/fcgi_base.py", line 507, in _sendall
     sent = sock.send(data)
 timeout: timed out

If you want to take a look at the application I'm running, you can find it here: http://bitheap.org/hg/streamtar/.

Change History

07/22/08 11:29:47 changed by asaddi

  • milestone changed from flup.server-1.0.1 to flup.server-1.0.2.

09/11/08 13:26:20 changed by asaddi

Needs more research. I'm guessing the socket timeout is too low between flup's FastCGI server and the FastCGI adapter.

For dynamic FastCGI processes, the sockets are actually passed to the application. So I'm wondering if there might be a mod_fastcgi setting?

02/02/09 23:39:44 changed by asaddi

  • milestone deleted.