Opened 2 years ago

Last modified 2 years ago

#5773 enhancement new

Request Timeout for web.client.Agent

Reported by: oberstet Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight Branch:
Author: Launchpad Bug:

Description

Agent should have an option to set the request timeout.

Currently, the old getPage has

  • option to set request timeout
  • no option to set connectionTimeout
  • no persistent connection pool

and Agent has

  • no option to set request timeout
  • option to set connectionTimeout
  • persistent connection pool

So Agent is lacking behind getPage wrt to request timeout.

The attached patch adds a request timeout option. When the timeout hits, the request fails with twisted.web._newclient.ResponseNeverReceived.

The request timeout is for the whole request, that is setup as soon as the request has been started to write to the transport. It is not a response-only timeout that would only be started when the producer has finished producing and then timeout for receiving the response.

Attachments (1)

patch1.diff (3.1 KB) - added by oberstet 2 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 2 years ago by DefaultCC Plugin

  • Cc jknight added

Changed 2 years ago by oberstet

comment:2 Changed 2 years ago by itamar

I would prefer this be done via a generic timeout mechanism added to Deferreds (utilizing Deferred cancellation). However, if that feature doesn't happen soon having built-in timeouts is certainly much better than nothing.

comment:3 Changed 2 years ago by exarkun

I would prefer this be done via a generic timeout mechanism added to Deferreds (utilizing Deferred cancellation).

Me too, strongly.

Note: See TracTickets for help on using tickets.