DnsOverHttps Fixups: event sequencing, resolvePublicAddresses, IPv6 first#9553
Open
swankjesse wants to merge 3 commits into
Open
DnsOverHttps Fixups: event sequencing, resolvePublicAddresses, IPv6 first#9553swankjesse wants to merge 3 commits into
swankjesse wants to merge 3 commits into
Conversation
yschimke
reviewed
Jul 17, 2026
| } | ||
|
|
||
| override fun isCanceled() = state.get() is State.Canceled | ||
| override fun isCanceled() = calls.all { it.isCanceled() } |
Collaborator
There was a problem hiding this comment.
I think given RealCall, this works in practice.
But based on the interface of Call, it could be racy?
/** Cancels the request, if possible. Requests that are already complete cannot be canceled. */
fun cancel()
So if some are completed, and you are using some other Call impl, which I know is unlikely, it may not be correct when one call already completed?
yschimke
approved these changes
Jul 17, 2026
yschimke
left a comment
Collaborator
There was a problem hiding this comment.
one question about cancellation
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.
The biggest change here is we’re now requesting TYPE_AAAA (IPv6) records first in all DnsOverHttps calls. This should be a negligible behavior change for most applications as the two calls can execute in parallel. The order only really matters when there’s a limit on the total concurrency against the DNS service. (This is the case for our tests, which only permit 1 call at a a time.)
Fix some bugs in how events are delivered to the callback. Always deliver events on OkHttp’s dispatcher thread. This includes cancel events and resolvePublicAddress validation. Otherwise it’s surprising if the callback is sometimes invoked by the thread calling
enqueue().