[Twisted-web] Agent request timeout
johnaherne at rocs.co.uk
Thu Jul 7 03:31:02 EDT 2011
So far this is where I have got to.
In my timeout using callLater, I call d._canceller().
This calls _connectionLost_WAITING which is partly what I would expect. But
it does not call _canceller_WAITING which I would have expected as well.
The function at d._canceller would appear to be cancelConnection so I can
see why it would go to loseConnection right away. But I have not found
where cancelConnection resides yet.
The _connectLost_WAITING then calls disconnectParser and finally does the
errback with ResponseFailed and the connection is dropped cleanly.
The fact that _canceller_WAITING is not called makes me think I am making
the wrong call on the request deferred when I use d._canceller(), but I have
not seen anything else I can call.
Also d._canceller requires a parameter. And I can pass it anything and it
seems to not make use of any argument I pass in. I have used d the deferred,
None, 'TRANSMITTING' the string all with exactly the same effect.
So it makes me think I am making the wrong call on the request deferred.
Does anyone know if I should be calling some other function.
Below is the result from a test run outputting various points the program
runs through which might be helpful.
dispatcher <function dispatcher at 0x00FD57B0> template <function
dispatcher <function dispatcher at 0x00FD58F0> template <function
ved at 0x00FD58B0>
dispatcher <function dispatcher at 0x00FD5A30> template <function
hed at 0x00FD59F0>
dispatcher <function dispatcher at 0x00FD5F70> template <function _canceller
dispatcher <function dispatcher at 0x00FD9170> template <function
body <stringprod_resp.StringProducer object at 0x00F9BCB0>
fff canceller <function cancelConnect at 0x00FD95B0>
got do cancel
connectionlost waiting [Failure instance: Traceback (failure with no
lass 'twisted.internet.error.ConnectionDone'>: Connection was closed
disconnect parser [Failure instance: Traceback (failure with no frames):
'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
got error <bound method Failure.getErrorMessage of
re <class 'twisted.web._newclient.ResponseFailed'>>>
Thanks for any info.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-web