[Twisted-Python] producer/resuming issue?

Yun Mao maoy at cis.upenn.edu
Mon Oct 6 23:12:21 EDT 2003

I sometimes encounter the problem that when a connection (producer) has
been lost, the consumer still try to call resumeProducing() to the
producer, so that a non-valid fileno is added to the select loop, and 
generate endless error messages. 

I'm almost sure that this is b/c I didn't do unregisterProducer() at the 
correct time. Even though, I feel like endless error messages are not very 
pleasant. Could anyone help to fix this? My temp solution is that 
I modified the abstract.py and tcp.py to set a flag indicate whether the 
fileno is deleted or not, and won't let resumeProducing to add a invalid 
reader into the reactor. Any better suggestions?

To play with this bug, you may want to modify socks.py, add these into 

        self.socks.transport.registerProducer(self.transport, 0)
        self.transport.registerProducer(self.socks.transport, 0)

More information about the Twisted-Python mailing list