Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Configure default timeout for all API calls  #1961

Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
@hterik

Description

@hterik
Issue body actions

What is the feature and why do you need it:
All API calls done through this client today goes through urllib3, where the timeout is default to set to None, this means infinite timeout and is a well known pitfall with urllib3. Lost connection attempts can get stuck waiting forever, with no retries being done to reestablish the connection.

Quoting the requests-documentation which uses urllib3 under the hood:

Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely:


There is a _request_timeout kwargs argument that can be set on each api-call, but that is both tedious, easy to forget and not type-checked due to use of kwargs-dictionarly.

Describe the solution you'd like to see:
Similar to how retries is configured, Configuration should accept a timeout-argument, this can be forwarded into urllib3s poolmanager where it uses this timeout for all operations where an explicit timeout is not provided.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.