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

Limit parallel requests to Philips Hue #29174

Closed
balloob opened this issue Nov 28, 2019 · 0 comments · Fixed by #29189
Closed

Limit parallel requests to Philips Hue #29174

balloob opened this issue Nov 28, 2019 · 0 comments · Fixed by #29189

Comments

@balloob
Copy link
Member

balloob commented Nov 28, 2019

Home Assistant release with the issue: 0.102

Last working Home Assistant release (if known): 0.100

Integration: Hue

Description of problem:
In #27078 we made turning lights on be limited by the same semaphore as the updates. This semaphore is 1 for sync integrations and unlimited for async integrations.

This is a problem for Hue, which is async, but cannot handle unlimited parallel requests. This results in issues like #29152 and #29087 where the Hue bridge kills incoming connections.

We need to limit the number of parallel requests to the Hue bridge and we need to do this by having HueBridge (hue/bridge.py) provide a sempahore that we can use when reaching out to the API. We should initialize it inside HueBridge.async_setup and base it on the model of the hub (bridge.api.config.modelid, values are BSB001 and BSB002 I think).

For using the semaphore with random requests, we can adopt the way we do it for Entity.async_request_call. We just pass a coro in.

For values of the semaphore, homebridge uses 3 parallel for the old bridge and 10 for the newer one (source). Let's adopt that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants