[Twisted-Python] notifyFinish not being called on Windows 10 Twisted 16.4.1

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Oct 18 02:18:39 MDT 2016


> On Oct 18, 2016, at 12:29 AM, John Aherne <johnaherne at rocs.co.uk> wrote:
> 
> Having read the irc log a few times I'm still not clear what is meant to happen.
> 
> I can't see under what circumstances notifyFinish will return a Failure.

The difference between firing with None and firing with a Failure is extremely subtle.  If the client connection terminates "before it's ready" then you'll get an Failure, but this is fairly fuzzily defined in terms of application-level semantics.  A connection that is "not ready" to terminate might be one that has outstanding data to send to the client which the client doesn't receive, or a connection which has only partially received a request.  There are other low-level details of the socket which might also be relevant (for example, I think you might also get this if the client neglects to send a CLOSE_ALERT TLS message).

For most applications, the difference between "failure" and "success" in this case just isn't very interesting.

As Corey identified earlier in the thread though, _also_ a bug where it isn't being called all the time when we expect it.  As the ticket said though, you can try to work around this by just calling resumeProducing() unconditionally at the beginning of your request processing...

-glyph






More information about the Twisted-Python mailing list