Repository navigation
Fix DNS worker lifetime and add a synchronous resolver fallback - #656
Merged
Merged
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
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.
Fix detached resolver ownership and expose the synchronous DNS workaround requested in #364, while preserving cancellable hostname lookups by default.
USE_ASYNC_DNS. Setting it to OFF routes hostname queries through the existing synchronous path, so affected full-static glibc deployments can use the workaround without editing the library. The documentation explains that cancellation/stop must then wait for the system resolver. This does not remove glibc/NSS runtime deployment requirements.Validation: both DNS modes pass 15 assertions, with new local cases finishing under 1 ms. Full plain-socket suite: 31/31 passed; targeted ThreadSanitizer and MinGW compilation checks passed. A controlled ASan/UBSan probe blocked the resolver, cancelled/destroyed its lookup, then released it: 50 workers completed safely after owner destruction. Fully static Linux/glibc executables passed 30 numeric/localhost lookups; the synchronous CMake build also resolves stack-owned hostname lookups with the default API, proving it creates no worker. Strict C++11 warnings-as-errors builds and formatting/diff checks passed. No new unit test sleeps or waits for a network timeout.
Closes #364 by exposing the requested synchronous-resolution fallback. Related to #406, whose application-specific post-message thread growth still needs a current reproduction. Includes the same validated Darwin errno/TSan workaround carried by #651/#653.