-
-
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
Fixes read_timeout on WS connection not respecting ws_connect's timeouts #8445
Conversation
2bb2387
to
72bb110
Compare
Please see aio-libs#8445 for the source PR
11b2682
to
28f126c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8445 +/- ##
=======================================
Coverage 97.61% 97.62%
=======================================
Files 107 107
Lines 33159 33230 +71
Branches 3895 3902 +7
=======================================
+ Hits 32369 32440 +71
Misses 571 571
Partials 219 219
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
FYI I'm working on a backport for 3.9. |
Please see aio-libs#8445 for the source PR
b74ddd7
to
f96e11a
Compare
Added read_timeout property to ResponseHandler to allow override After WS(S) connection is established, adjust `conn.proto.read_timeout` to be the largest of the `read_timeout` and the `ws_connect`'s `timeout.ws_receive` with `None` treated as 'no timeout', i.e. the maximum. fixes aio-libs#8444
Please see aio-libs#8445 for the source PR
Please see aio-libs#8445 for the source PR
We will need to backport to 3.10 as well as I'm not sure if we plan on doing any more 3.9 releases before 3.10 starts rolling out. |
I want to leave this note here for whoever comes looking. Between 3.9 and master (f662958) there was a change in the interpretation of WS timeouts. Not considering |
@bdraco |
That's one I can't answer as I've not done a release for this project before (only reviews + code) so I'll defer to other members to answer. |
… not respecting ws_connect's timeouts aio-libs#8444 Please see aio-libs#8445 for the source PR
@bdraco @Dreamsorcerer posted 3.10 backport as well. It's virtually identical to 3.9. |
I think that may be a missing backport. Seems sensible that the change should have been backported, same as the .request() method now uses ClientTimeout. |
I don't expect any regressions, but just to be safe I'll push the 3.9 backport to a few production Home Assistant instances and run it overnight to test |
I don't think so. That's an API change and it was posted in 2019/0. It introduces new user-facing timeout data structures in public API: |
I'm not planning to do another 3.9 release unless there's a notable security issue (but, I think we can plan to do the 3.10 release soon if we want). |
Pleeeeeeeease? 😄 I really don't want to vendorize the entire aiohttp fork over this. Unless you're planning on releasing 3.10 this weekend? |
Yes, looks like the same change as ClientTimeout. The old parameters are deprecated, but still maintained for backwards compatibility in 3.x. I suspect the same should have been done for this. There are a lot of old PRs which missed backports by mistake (you'll see the PRs have no backport labels at all). It's why I added a CI check that backport labels are added to every PR, so we can be sure whether a PR was intended to be backported or not. |
I'm not doing any release this weekend. :P |
Well, I had to try ;) Now I have to go patch the installed library at runtime to make sure this fix gets in. |
Pushed to a few production Home Assistant instances. Nothing blew up. Will report back in the morning before I'm traveling again. |
All good overnight |
Backport to 3.10: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply b860848 on top of patchback/backports/3.10/b860848ab49177f98ac91cf6faa16037fc99bef2/pr-8445 Backporting merged PR #8445 into master
🤖 @patchback |
@arcivanov We are getting closer to releasing 3.10. Would you kindly take care of the backport? |
@bdraco I was under impression I already did. Is it conflicting? I'll confirm in a couple of hours. |
You did, I forgot about them #8447 |
Added
read_timeout
property toResponseHandler
to allow overrideAfter WS(S) connection is established, adjust
conn.proto.read_timeout
tobe the largest of the
read_timeout
and thews_connect
'stimeout.ws_receive
withNone
treated as 'no timeout', i.e. the maximum.fixes #8444
Checklist
CONTRIBUTORS.txt
CHANGES/
foldername it
<issue_or_pr_num>.<type>.rst
(e.g.588.bugfix.rst
)if you don't have an issue number, change it to the pull request
number after creating the PR
.bugfix
: A bug fix for something the maintainers deemed animproper undesired behavior that got corrected to match
pre-agreed expectations.
.feature
: A new behavior, public APIs. That sort of stuff..deprecation
: A declaration of future API removals and breakingchanges in behavior.
.breaking
: When something public is removed in a breaking way.Could be deprecated in an earlier release.
.doc
: Notable updates to the documentation structure or buildprocess.
.packaging
: Notes for downstreams about unobvious side effectsand tooling. Changes in the test invocation considerations and
runtime assumptions.
.contrib
: Stuff that affects the contributor experience. e.g.Running tests, building the docs, setting up the development
environment.
.misc
: Changes that are hard to assign to any of the abovecategories.
Make sure to use full sentences with correct case and punctuation,
for example:
Use the past tense or the present tense a non-imperative mood,
referring to what's changed compared to the last released version
of this project.