[Twisted-Python] Reactor Spinning?

Moxie Marlinspike moxie at thoughtcrime.org
Wed May 5 08:20:21 MDT 2010


Hey Itamar, the problem is that this only occurs under heavy load in a
production environment (of course!), so I don't really have any way of
testing a simplified version.

The code itself is fairly simple, however, and is almost identical to
the code that ships in twisted.web.proxy.

This is to say that I'm simply shuttling data between an HTTPClient
object and a Request object.  I never call transport.resumeProducing()
or startWriting() myself, and I only call transport.write() in exactly
one place (when sending POST data via HTTPClient).  The rest of the time
I'm writing to either the Request object (not its transport) when
communicating back to the clients, or availing myself of higher-level
methods like HTTPClient.sendHeader() when writing to the server side.

The code is available here:
http://www.googlesharing.net/server/googleshare-0.9.tar.gz

- moxie

-- 
http://www.thoughtcrime.org


Itamar Turner-Trauring wrote:

> Can you produce a minimal reproducing example of a program that has this
> issue? I can imagine a code bug where you're calling
> transport.resumeProducing() or startWriting() sometime when you shouldn't,
> except the empty write() does look wrong... a minimal code sample would
> help.




More information about the Twisted-Python mailing list