Conversation
…retried Motivation: akka/akka-core#32114 fixed AsyncDnsResolver leaving failed resolutions in its in-flight map, which blocked retries of the same name. Pekko's resolver already clears the in-flight entry on failure, but there was no regression test for it. Modification: Add an AsyncDnsResolverSpec case where two senders resolve the same name, the DNS client fails, both senders receive the failure, and a subsequent resolve from both senders is sent to the client again and succeeds. Result: The retry-after-failure behaviour of AsyncDnsResolver is covered by a test. Tests: - sbt "actor-tests/testOnly org.apache.pekko.io.dns.internal.AsyncDnsResolverSpec" (22 passed, run 3 times) - native scalafmt run on the changed file References: None - port of the test from akka/akka-core#32114
pjfanning
force-pushed
the
dns-clear-inflight-on-failure
branch
from
September 21, 2026 14:25
e6375c0 to
a6f7dae
Compare
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.
Motivation
Port of the test from akka/akka-core#32114 (backport of akka/akka-core#32110), which covers
AsyncDnsResolverclearing a failed resolution from its in-flight map so that a later resolve of the same name is retried rather than blocked.Pekko's resolver already behaves this way - the
ResolutionAnswerhandler fans a failure out to every waiter and removes the in-flight entry - so no main-code change is needed, but this scenario had no regression test.Modification
Add an
AsyncDnsResolverSpeccase: two senders resolve the same name, the second joins the in-flight resolution (no second question is sent), the DNS client replies with a failure, both senders receiveStatus.Failure, and a subsequent resolve from both senders is sent to the client again and succeeds.The Akka test relies on a 1 ms
resolve-timeoutand an autopilot that ignores the first question. This port drives the clientTestProbeexplicitly instead (same style as the existing "reuse in-progress resolutions" case) so it has no timing dependency.Result
The retry-after-failure behaviour of
AsyncDnsResolveris covered by a test. No main-code change.Tests
sbt "actor-tests/testOnly org.apache.pekko.io.dns.internal.AsyncDnsResolverSpec"- 22 passed, run 3 timesReferences
None - port of the test from akka/akka-core#32114. Akka source is Apache-2.0 licensed as of 2023-09-20.