[Twisted-Python] Re: [Twisted-commits] r12418 - survive a re-entrant call to .resumeProducing, which happens under the cf

On Nov 8, 2004, at 9:06 PM, Brian Warner wrote:
Modified: trunk/twisted/web/static.py Log: survive a re-entrant call to .resumeProducing, which happens under the cf reactor
Ew ew ew ew! That's just broken, reactors *really* shouldn't do that. I am pretty sure no resumeProducing implementations expect to be called again in response to their own write(), nor should they have to. James

On Mon, Nov 08, 2004 at 10:15:32PM -0500, James Y Knight wrote:
On Nov 8, 2004, at 9:06 PM, Brian Warner wrote:
Modified: trunk/twisted/web/static.py Log: survive a re-entrant call to .resumeProducing, which happens under the cf reactor
Ew ew ew ew! That's just broken, reactors *really* shouldn't do that. I am pretty sure no resumeProducing implementations expect to be called again in response to their own write(), nor should they have to.
How about writing (and committing) a test case? ;) -Andrew.

On Tue, 9 Nov 2004 05:01:38 +0100, Andrew Bennetts <andrew-twisted@puzzling.org> wrote:
On Mon, Nov 08, 2004 at 10:15:32PM -0500, James Y Knight wrote:
On Nov 8, 2004, at 9:06 PM, Brian Warner wrote:
Modified: trunk/twisted/web/static.py Log: survive a re-entrant call to .resumeProducing, which happens under the cf reactor
Ew ew ew ew! That's just broken, reactors *really* shouldn't do that. I am pretty sure no resumeProducing implementations expect to be called again in response to their own write(), nor should they have to.
How about writing (and committing) a test case? ;)
This sounds like a pretty hard thing to write a test case for. What did you have in mind? Jp

On Mon, 2004-11-08 at 22:15 -0500, James Y Knight wrote:
On Nov 8, 2004, at 9:06 PM, Brian Warner wrote:
Modified: trunk/twisted/web/static.py Log: survive a re-entrant call to .resumeProducing, which happens under the cf reactor
Ew ew ew ew! That's just broken, reactors *really* shouldn't do that. I am pretty sure no resumeProducing implementations expect to be called again in response to their own write(), nor should they have to.
Ugh. Violent agreement. I imagine that this is due to confusion caused by the "streaming" flag, but resumeProducing should be called only in the context of a main-loop iteration.
participants (4)
-
Andrew Bennetts
-
exarkun@divmod.com
-
Glyph Lefkowitz
-
James Y Knight