-
Notifications
You must be signed in to change notification settings - Fork 654
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
GetaddrinfoResolver succeeds futures on eventLoop #3042
GetaddrinfoResolver succeeds futures on eventLoop #3042
Conversation
Motivation: `testClientBindWorksOnSocketsBoundToEitherIPv4OrIPv6Only` would fail sometimes leaking the IPv4 promise in `GetaddrinfoResolver` `HappyEyeballsConnector` returns the connection when it resolves either IPv4 of IPv6. It uses the `GetaddrinfoResolver` which holds a promise for each of the IPv4 and IPv6 resolution; when one is completed it is possible to start tearing down the test and shutting down the event loop before the other is completed and we leak the promise. Modifications: Complete both futures on the event loop rather than the dispatch queue. Result: The futures are completed in the same event loop tick meaning that we cannot continue execution and leak one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5.9 thresholds are off it seems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one.
Motivation:
testClientBindWorksOnSocketsBoundToEitherIPv4OrIPv6Only
would fail sometimes leaking the IPv4 promise inGetaddrinfoResolver
HappyEyeballsConnector
returns the connection when it resolves either IPv4 of IPv6. It uses theGetaddrinfoResolver
which holds a promise for each of the IPv4 and IPv6 resolution; when one is completed the connection will be returned and it is possible to start tearing down the test and shutting down the event loop before the other is completed and we leak the promise.Modifications:
Complete both futures on the event loop rather than the dispatch queue.
Result:
The futures are completed in the same event loop tick meaning that we cannot continue execution and leak one.