Skip to content
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

Drop aiohttp to 3.8.1 #83795

Merged
merged 1 commit into from
Dec 12, 2022
Merged

Drop aiohttp to 3.8.1 #83795

merged 1 commit into from
Dec 12, 2022

Conversation

balloob
Copy link
Member

@balloob balloob commented Dec 12, 2022

Breaking change

Proposed change

Drop aiohttp to 3.8.1 from 3.8.3.

3.8.3 included "fix" aio-libs/aiohttp#6719 to align the behavior of aiohttp with the documentation, which is that request handlers no longer get cancelled when the client disconnects. We did not anticipate such a behavioral change in a patch release and so didn't catch this in time. It seems like it contains a bug where a StreamResponse will not raise when written to, causing our MJPEG streams to eat up all the memory (as it writes a new image every 0.5s to the stream without any back pressure).

In aio-libs/aiohttp#7056 a new parameter was added that allows enabling the old cancellation behavior. This has not been released yet.

Before upgrading, we should explore if we want cancellation and if we don't, we should fix the StreamResponse eating all the memory. Two tests got fixed in #82788 for the 3.8.3 upgrade, which are at least 2 spots that would need to fix.

Fixes #83661

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@balloob balloob added this to the 2022.12.3 milestone Dec 12, 2022
@balloob balloob requested a review from a team as a code owner December 12, 2022 01:32
@balloob
Copy link
Member Author

balloob commented Dec 12, 2022

I can reproduce the failed test with 3.8.3 locally. It is making a network connection. Will fix that in a separate PR.

@phr0z
Copy link

phr0z commented Dec 12, 2022

I think this change broke casting lovelace to Google Nest Hub from "browse media tab", at least for me. Worked pre 2022.12.3 (2022.12.2). Verified by rolling back.

@frenck
Copy link
Member

frenck commented Dec 12, 2022

@phr0z If you experience an issue, could you please raise an issue in the issue tracker?
Tracking issues on merged pull requests is hard to keep track of.

Thanks! 👍

../Frenck

@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak since 2022.12
4 participants