[Twisted-web] Timeouts on Agent requests

Erik Forsberg forsberg at opera.com
Mon Aug 20 03:17:10 EDT 2012

On 2012-08-20 07:34, Erik Forsberg wrote:
> Will this also automatically give me a connection timeout, or should I
> give Agent's constructor connectTimeout as argument and handle that in
> handle_errors too?

After some experiments, I think I can answer my own question:

* If you're using a callLater to deferred.cancel only, regardless of 
cause of the timout (connection timeout or request timeout), your 
errback will get ConnectingCancelledError.

* If you use connectTimeout and a delayed call to deferred.cancel, and 
connectTimeout set to a lower value than the callback to 
deferred.cancel, you will get a TimeoutError in your errback if the 
connection times out. This allows you to distuingish between connection 
timeouts and request timeouts.


More information about the Twisted-web mailing list