Closed dieb closed 4 months ago
@swift-server-bot add to allowlist
@swift-server-bot add to allowlist
@swift-server-bot add to allowlist
@swift-server-bot test this please
Something is wrong with the webhook so CI is not getting triggered. Will ask someone for help looking into it in the morning.
@swift-server-bot test this please
@dieb Would you be comfortable making similar changes to
DNSSD.query
andQueryReplyHandler
as well? If not, it's ok.
Absolutely, thanks for the oppo. Should be a quick thing.
@yim-lee I made the change for DNSSD but I was unable to test locally, test_concurrency hangs. I'm also getting errors on CAresDNSResolverTests test_queryTXT
and test_concurrency
. Would rely on you folks to review if the last commit is appropriate.
but I was unable to test locally, test_concurrency hangs.
@dieb Does this happen even before these changes?
I'm also getting errors on CAresDNSResolverTests test_queryTXT and test_concurrency.
Are these errors due to no results?
Same errors are happening in main and 1f5d6f46ac17e74d335b8fba668e5228510dbb8e (before #30), so I'm guessing it's something to do with my local environment.
Running swift test
directly in the command-line without the docker-compose thingy and I noticed only mDNSResponder
shows up in ps | grep dns
, not sure if I need anything else for DNSSD.
Edit: errors are connection refused and test_concurrency hanging.
Motivation
29
Modifications
Frankly not too sure exactly why this fixes the leak (Swift noob here), but it may be that
pointer.deallocate()
only frees the pointer, and not the underlying initialized.Result
QueryReplyHandler gets deallocated properly and so does the continuation that was leaking.
Leaks from this are gone when running A/AAAA queries.
Test Plan
Running Xcode leaks instrument in my app, some code examples in #29 .