[Twisted-Python] problem on running apache2 + scgi

Chris chris.yan at saybot.com
Thu Jul 2 03:07:02 EDT 2009

I was working on a project which use twisted.web2 scgi.I chose apache2
as the front end web server.the apache2 server will receive a http POST
message which carry about 200k-1M data.I found that sometimes I get the
correct answer but sometimes there is a exception:
Traceback (most recent call last):
File "//usr/lib64/python2.5/site-packages/twisted/python/log.py", line
84, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "//usr/lib64/python2.5/site-packages/twisted/python/log.py", line
69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib64/python2.5/site-packages/twisted/python/context.py",
line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib64/python2.5/site-packages/twisted/python/context.py",
line 37, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
line 146, in _doReadOrWrite
why = getattr(selectable, method)()
File "/usr/lib64/python2.5/site-packages/twisted/internet/tcp.py", line
463, in doRead
return self.protocol.dataReceived(data)
File "/usr/lib64/python2.5/site-packages/twisted/web2/channel/scgi.py",
line 72, in dataReceived
File "/usr/lib64/python2.5/site-packages/twisted/web2/http.py", line
393, in handleContentChunk
File "/usr/lib64/python2.5/site-packages/twisted/web2/http.py", line
331, in write
stream.ProducerStream.write(self, data)
File "/usr/lib64/python2.5/site-packages/twisted/web2/stream.py", line
667, in write
exceptions.AttributeError: SCGIChannelRequest instance has no attribute

it seems the error is from the twisted.web2 module,usually when the data
is very big,I will get this exception.how to avoid this exception? I
have to transfer the data in one request anyway.
Any suggestion is helpful.Thank you!


More information about the Twisted-Python mailing list