8000 Fix #14919. Should throw exception when camera stream closed by frontend by awarecan · Pull Request #15028 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix #14919. Should throw exception when camera stream closed by frontend #15028

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

Merged
merged 3 commits into from
Jun 25, 2018

Conversation

awarecan
Copy link
Contributor
@awarecan awarecan commented Jun 17, 2018

Description:

When user closed camera stream window, we should simply abort the stream by thrown exception. The issue has been masked before aiohttp 3.3.0. However after 3.3.0, if you try to operate on closed connection, a ConnectionResetError will be thrown instead of asyncio.CancelledError. ConnectionResetError will eventually throw to top level, since nobody handle it (should not be handled)

Change to re-throw asyncio.CancelledError fix the issue.

Related issue (if applicable): fixes #14919

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@pvizeli
Copy link
Member
pvizeli commented Jun 18, 2018

I'm not sure if that is the correct fix. It's also not python like to catch a exception for reraise it later, please fix that.

I'll check that local. Thanks for discover a solution.

@awarecan
Copy link
Contributor Author
awarecan commented Jun 18, 2018

I just keep that logging statement to keep backward compatibility. If you don't like reraise, we can simply not catch asyncio.CancelledError, the caller will quietly handle that exception.

@awarecan
Copy link
Contributor Author

@pvizeli any update? More people reported that issue.

@pvizeli
Copy link
Member
pvizeli commented Jun 25, 2018

Please cleanup the exception handling to pythonic -> http://www.ianbicking.org/blog/2007/09/re-raising-exceptions.html

We have time until end of this week before next beta comes.

@pvizeli pvizeli self-requested a review June 25, 2018 07:05
@pvizeli pvizeli self-assigned this Jun 25, 2018
@balloob balloob merged commit 508d045 into home-assistant:dev Jun 25, 2018
@ghost ghost removed the in progress label Jun 25, 2018
pvizeli added a commit that referenced this pull request Jun 25, 2018
pvizeli added a commit that referenced this pull request Jun 25, 2018
* Revert "Fix #14919. Should throw exception when camera stream closed by frontend (#15028)"

This reverts commit 508d045.

* Revert "Fix pylintrc section order and option placements (#15120)"

This reverts commit dbae410.

* Revert "Add storage helper and migrate config entries (#15045)"

This reverts commit ae51dc0.

* Revert "Add language to dark sky weather component (#15130)"

This reverts commit 672a3c7.
@balloob balloob mentioned this pull request Jul 6, 2018
@awarecan awarecan deleted the fix-14919-v2 branch July 17, 2018 18:01
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
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.

AIOHTTP ConnectionResetError On Camera Close after 3.3.0
4 participants
0