Use a single service browser for zeroconf discovery#35997
Merged
MartinHjelmare merged 3 commits intohome-assistant:devfrom May 23, 2020
Merged
Use a single service browser for zeroconf discovery#35997MartinHjelmare merged 3 commits intohome-assistant:devfrom
MartinHjelmare merged 3 commits intohome-assistant:devfrom
Conversation
Currently we start a service browser thread for every zeroconf type. Support was added to upstream python-zeroconf to allow a single service browser to listen for multiple types. This solves the problem where each new integration that is discovered by zeroconf requires another thread and has to process the incoming data another time which did not scale.
Contributor
|
is there queuing for incoming responses? just wonder if we need to balance the threads out so that we dont overwhelm a single thread. |
Member
Author
|
Member
Author
|
/AzurePipelines Run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
@ctalkington Everything goes into a callback queue so it should be fine |
20 tasks
20 tasks
MartinHjelmare
approved these changes
May 23, 2020
This was referenced May 24, 2020
Contributor
|
Added to 0.110.4: #36185 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Currently we start a service browser thread for every
zeroconf type. Support was added to upstream
python-zeroconf to allow a single service browser to
listen for multiple types.
This solves the problem where each new integration that
is discovered by zeroconf requires another thread and
has to process the incoming data another time which
did not scale.
Additionally, the upstream changes include a fix for a zeroconf
race condition that takes down the service.
Upstream changes
Race Fix: python-zeroconf/python-zeroconf@24a0619
Service Browsers: python-zeroconf/python-zeroconf@a6ad100
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: