Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

feat: distinguish transport and execution time timeouts#424

Merged
busunkim96 merged 4 commits into
googleapis:masterfrom
plamut:iss-423-rework-timeout
Jan 22, 2020
Merged

feat: distinguish transport and execution time timeouts#424
busunkim96 merged 4 commits into
googleapis:masterfrom
plamut:iss-423-rework-timeout

Conversation

@plamut

@plamut plamut commented Jan 17, 2020

Copy link
Copy Markdown
Contributor

Closes #423.
Towards https://github.com/googleapis/google-cloud-python/issues/10137

This PR makes a distinction between the Requests transport timeout, i.e. the timeout parameter, and the total allowed execution time for the request() method, i.e. the max_allowed_time argument. These two are not mixed together anymore.

In other words, if timeout is passed in (set to, say, 60 seconds) and an underlying request takes longer, but the times between the bytes received by the socket are all under 60 seconds, the TimeoutGuard should not kick in and cause a timeout error (the cause of Storage #10137).

TimeoutGuard is only affected by max_allowed_time, which is None by default, making the guard a no-op.

In Requests transport treat ``timeout`` stricly as a transport
timeout, while the total allowed method execution time can be set
with an optional ``max_allowed_time`` argument.
@plamut plamut added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jan 17, 2020
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 17, 2020
Comment thread tests/transport/test_requests.py Outdated
Comment thread google/auth/transport/requests.py
Comment thread google/auth/transport/requests.py
plamut and others added 3 commits January 22, 2020 07:49
Co-Authored-By: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
@plamut plamut requested a review from busunkim96 January 22, 2020 08:30
@busunkim96 busunkim96 merged commit 52a733d into googleapis:master Jan 22, 2020
@plamut plamut deleted the iss-423-rework-timeout branch January 22, 2020 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make a clear distinction between the transport timeout and the total method time timeout

3 participants