-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client: _request.timeout cancels the current AND the next request #1879
Labels
Comments
fafhrd91
added a commit
that referenced
this issue
May 12, 2017
thanks for report! should be fixed in master |
Cool. Thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Long story short
_request.timeout
will cancel the current request AND the next request.Expected behaviour
I expected it to behave the same way as
aiohttp.Timeout
. In other words it should not leak the cancellation to the next request.Actual behaviour
_request.timeout
will callTimeoutHandle.__call__
which runsTimeoutHandle._callbacks
which runsTimerContext.timeout
which setsself._cancelled=True
and somehow it leads to the cancellation of the next call of the coroutine too.aiohttp.Timeout
does NOT callTimeoutHandle.__call__
Steps to reproduce
Run a local server on port 8888 (I left a sample code for it below). Make it slow to cause timeout errors from the client. In this example 2 seconds cause timeout error.
In order to see the difference between the behaviors, switch from
fetch = fetch_cancells
tofetch = fetch_works
and vice verca.Client
Results
This is what you get with
fetch = fetch_works
, aka expected behavior:And this is when
fetch=fetch_cancells
Basically with every new hit, the response alternates between Timeout and Cancelled instead of only staying on Timeout.
The sample server used
In case it helps, here is the server I used:
Your environment
The text was updated successfully, but these errors were encountered: