Repository navigation
Conversation
A failed lookup reported the error and ignored the listener result, so the backoff timer never scheduled another attempt. A channel created before its DNS name existed stayed in TRANSIENT_FAILURE after the name appeared. Retry with the existing backoff, including when the load balancer accepts the error by entering TRANSIENT_FAILURE. Repeated updateResolution calls still share one timer. Retries stop when the resolver is destroyed. getConnectivityState(true) does nothing after SHUTDOWN, so a synchronous watcher such as Client.waitForReady cannot restart a closed channel. Fixes grpc#3128
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.
Fixes #3128
Summary
Retry failed DNS lookups on
DnsResolver's existingBackoffTimeoutwhile the channel remains active, and guardInternalChannel.getConnectivityState(true)against restarting resolution once a channel has enteredSHUTDOWN.PickFirstLoadBalanceraccepts an error endpoint list by enteringTRANSIENT_FAILUREand returningtrue, soonLookupFailureschedules a retry viarequestAnotherResolution()even whenhealthStatus === trueinstead of callinghandleHealthStatus(true)(which would stop and reset backoff).#2098's per-attemptcontinueResolving = falsereset so repeatedupdateResolution()calls share a single timer without multiplying lookups, stops retries ondestroy()(bothIDLEandclose()), matches in-flight lookups by promise identity, and leaves unparseabledns:targets (dnsHostname === null) as one-shot errors.SHUTDOWNconnectivity watchers (such asClient.waitForReady) from callingexitIdle()duringclose()and restarting a destroyed resolver.Evidence
watchConnectivityState,Client.waitForReady, or a single queued wait-for-ready RPC stuck inTRANSIENT_FAILUREeven after the DNS record appeared.READY, goesIDLE, or closes (41passing tests acrosstest-resolver,test-dns-resolver-retry, and client suites, includingGRPC_NODE_USE_ALTERNATIVE_RESOLVER=true).Merge Danger
Door: Two-way
Scoped to
packages/grpc-js/src/resolver-dns.ts,packages/grpc-js/src/internal-channel.ts, and offline-stubbed DNS tests (ResolvingLoadBalanceris unchanged).Blast Radius: Narrow
Intentionally updates the test expectation from
#2105so active channels retry failed DNS resolutions with boundedBackoffTimeoutbackoff (aligning with C-core's polling resolver andgrpc-go's DNS watcher) while still halting atIDLEandSHUTDOWN.