-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Avahi ResolveContext Leak Fix: deduplicating resolveContext creation #41555
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
Draft
Alami-Amine
wants to merge
1
commit into
project-chip:master
Choose a base branch
from
Alami-Amine:AA/avahiDeduplicateResolveContext
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Avahi ResolveContext Leak Fix: deduplicating resolveContext creation #41555
Alami-Amine
wants to merge
1
commit into
project-chip:master
from
Alami-Amine:AA/avahiDeduplicateResolveContext
+26
−1
Conversation
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
…s each time we find a browseEvent, so basically deduplicating, we do that because avahi only calls the callback once per serviceInstance which means only a single resolveContext is freed.
|
PR #41555: Size comparison from 842aa2c to 6a8a66e Full report (37 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41555 +/- ##
==========================================
+ Coverage 51.04% 51.06% +0.02%
==========================================
Files 1386 1385 -1
Lines 100958 100901 -57
Branches 13061 13056 -5
==========================================
- Hits 51534 51528 -6
+ Misses 49424 49373 -51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
When using chip-tool using Avahi Dnssd, we get a few leaks, this PR fixes the one related to
ResolveContext*When browsing using Avahi, we often get duplicate entries (duplicate IP Addresses or duplicate Interfaces), and we end up allocating mutiple
ResolveContextsfor these duplicate entriesHowever, it seems that Avahi's only calls the
HandleResolvecallback once per service instance; so if we have two ResolveContexts with same IP Address for the same service/device, thenHandleResolveis only called once, and we end up not freeing one of the Resolve ContextsThe Fix: when Browsing using Avahi, we should deduplicate and only allocate a ResolveContext once per each serviceInstance, so basically deduplicating in order to only have one
ResolveContext*per ServiceInstanceThis only resolves one of the leaks, there are 2/3 more leaks left to address.
Testing
Leak Log