feat: make ServiceInfo aware of question history#1348
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1348 +/- ##
==========================================
- Coverage 99.77% 99.75% -0.03%
==========================================
Files 30 30
Lines 3164 3240 +76
Branches 528 536 +8
==========================================
+ Hits 3157 3232 +75
Misses 5 5
- Partials 2 3 +1 ☔ View full report in Codecov by Sentry. |
timing is not perfectly aligned due to random delay
Member
Author
|
need to let this run overnight to look for any errors in the log in the morning, but its working as expected and really helps a lot |
Member
Author
|
Can also dump |
bdraco
commented
Dec 16, 2023
Member
Author
|
testing looks good over night. memory is stable as well |
bdraco
added a commit
to bdraco/home-assistant
that referenced
this pull request
Dec 16, 2023
changelog: python-zeroconf/python-zeroconf@0.129.0...0.130.0 Major traffic reduction (fixed python-zeroconf/python-zeroconf#821 and python-zeroconf/python-zeroconf#1337) The ServiceBrower query scheduler has been rewritten from the ground up to use a heapq: python-zeroconf/python-zeroconf#1335 ServiceInfo requests are now aware of history and will now space asking questions far enough apart to avoid being suppressed python-zeroconf/python-zeroconf#1348
20 tasks
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.
If we have multiple consumers of service info asking the same question over and over they all get asked even though we only need to ask once. This can generate excessive amount of network traffic.
There was also a problem with
ServiceInfo.async_requestwould ask questions that would get suppressed by the duplicate question suppression of the responder. We now delay the question to ensure it will not get asked in the suppression window. Now thatpython-zeroconfServiceInfo is aware of the question history, the problem became visible because it was unable to get the expected answers from anotherpython-zeroconfinstance.fixes #1337
--
testing history:
TimerHandledump