GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(resolver-dns): skip negative cache entries during search-domain walkthrough by Asthenia0412 · Pull Request #17813 · netty/netty

Conversation

@Asthenia0412

@Asthenia0412 Asthenia0412 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Motivation

This PR addresses the remaining gap after the merge of #17623. The original issue (#17625) had two problems:

  1. The search-domain loop broke on any cached entry, positive or negative. → Fixed by Do not let a negatively cached search domain shadow a positive one #17623
  2. A cached negative entry for the bare hostname short-circuited the search-domain walkthrough entirely.

Problem #2 remains after #17623. When negativeTtl > 0 and a prior lookup cached an NXDOMAIN for the bare hostname foo, subsequent lookups for foo would return the cached failure without ever trying search-domain expansions like foo.ns1.svc.cluster.local. In Kubernetes deployments, this manifests as intermittent cross-namespace resolution failures.

Modification

  • Prefer a positive cache hit for the bare hostname immediately.
  • A negative bare-hostname entry now only tells us the FQDN lookup failed — we still walk through search-domain expansions looking for a positive entry.
  • Search-domain loop continues to skip negative entries (same fix as Do not let a negatively cached search domain shadow a positive one #17623).
  • Extracted tryCachedSuccess helper for cleaner code.

Comparison with #17623

Scenario #17623 behavior This PR behavior
Bare hostname has positive entry Return cached ✓ Return cached ✓
Bare hostname has no entries Walk search domains, skip negatives Walk search domains, skip negatives
Bare hostname has negative entry Return cached failure (bug) Walk search domains, skip negatives

Result

A negatively cached bare hostname no longer prevents search-domain walkthrough, fixing the intermittent Kubernetes cross-namespace resolution failures.

Fixes #17625.

Signed-off-by: Asthenia0412 [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Gabbo01 and others added 6 commits October 12, 2026 19:59
@Gabbo01
fix(resolver-dns): skip negative cache entries during search-domain w…
8fb15af
…alkthrough (netty#17625)

When several search domains are configured and negativeTtl > 0,
doResolveAllCached() would break out of the search-domain loop on the
first cached entry it found — regardless of whether that entry was a
positive resolution or a cached NXDOMAIN. A cached negative result for
an earlier search-domain expansion then shadows a successful cached or
live resolution for a later one, and resolution fails intermittently for
the full negative-ttl window.

Two problems in the previous logic:
  1. A cached negative entry for the bare hostname short-circuited the
     search-domain walkthrough entirely.
  2. The search-domain loop broke on any cached entry, positive or negative.

A negative cache entry for <host>.<searchDomain> only tells us that this
one permutation does not exist — it says nothing about later search
domains. Only positive entries should short-circuit the lookup.

Fixes netty#17625.

Signed-off-by: Asthenia0412 <[email protected]>
@Asthenia0412
fix(ci): remove stale SNAPSHOT versions before uploading native quic …
025dc3e
…jars

The Maven cache restored via cache-maven-* keys can carry SNAPSHOT versions
from earlier builds. When pom.xml bumps the SNAPSHOT number (e.g. 4.2.19 ->
4.2.20 after a release) the old directory is still in the cache. Uploading
the whole tree would hand the verify legs two different native quic jars on
the classpath, which makes NativeLibraryLoader fail with:
  IllegalStateException: Multiple resources found for ... with different content

This happened after netty 4.2.19 was released on 2026-10-06; all subsequent
PRs and push runs to 4.2 failed the musl-verify workflow for exactly this
reason, regardless of their code changes.

Drop any non-current netty SNAPSHOT version directory before we ship the
artifact so only the freshly-built jars end up in the classpath.
@Asthenia0412
Merge branch '4.2' into fix/dns-negative-cache-search-domain
358e112
Signed-off-by: Asthenia0412 <[email protected]>
CI Fix Bot
fix(ci): update stale test that verified buggy negative-cache behavior
7fe4e69
The test testNegativelyCachedBareHostnameStillShortCircuits verified the old
buggy behavior where a negatively cached bare hostname would short-circuit the
search-domain walkthrough. PR netty#17813 fixes exactly this bug (see netty#17625).

Rewrite the test to exercise the corrected behavior: a negatively cached bare
hostname must NOT block search-domain expansion; the resolver should continue
walking search domains to find a positive cache hit.

Signed-off-by: CI Fix Bot <[email protected]>
CI Fix Bot
chore: re-trigger CI
74150df
@Asthenia0412
Merge remote-tracking branch 'origin/4.2' into fix/dns-negative-cache…
e88dcea
…-search-domain
@Asthenia0412

Asthenia0412 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Investigated the 2 boringssl build failures (linux-x86_64-java11-boringssl and linux-x86_64-java11-boringssl-jdk8-tests).

Conclusion: pre-existing CI flake — not caused by this PR.

Evidence:

  1. This PR only touches 3 files:

    • resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java (DNS negative-cache + search-domain walkthrough logic)
    • resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java (matching test)
    • .github/workflows/ci-verify-musl.yml (musl artifact cleanup)
      No files under boringssl/, openssl/, native/, tcnative/, or any SSL-related paths.
  2. Other boringssl builds in the SAME run all passed:

    • ✓ windows-x86_64-java11-boringssl (Windows)
    • ✓ macos-x86_64-java11-boringssl build (macOS Intel)
    • ✓ macos-aarch64-java11-boringssl build (macOS Apple Silicon)
  3. Linux non-boringssl builds also passed:

    • ✓ linux-x86_64-java11 build
    • ✓ linux-x86_64-java11-awslc build (alternative SSL backend)
    • ✓ All java17/java21/java24/java25/java26 builds
  4. Both failing jobs report the failure at the Checking for test failures step (the final test-report check), not during BoringSSL C compilation itself — suggesting an infrastructure/test-report artifact issue on that specific matrix row.

  5. A recently merged PR (Skip JNDI nameserver lookup on IBM i #17872) on the same 4.2 branch had both boringssl jobs pass on identical workflow matrix — confirming the boringssl pipeline is generally healthy.

Also rebased this PR onto the latest origin/4.2 (clean merge, no conflicts) to keep it fresh. PR is MERGEABLE.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@testlens-app

testlens-app Bot commented Oct 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🚨 TestLens detected 2 failed tests 🚨

Failed Jobs without Test Failures

❌ Build PR / linux-x86_64-java26 build

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 17813

Build PR / windows-x86_64-java11-boringssl > Netty/Handler/Ssl/Ocsp

Test Runs Flakiness
OcspClientTest > simpleOcspQueryTest(String) > [1] https://apple.com ❌ 1% 🟡
OcspServerCertificateValidatorTest > connectUsingHttpAndValidateCertificateUsingOcspTest() ❌ 1% 🟡

🏷️ Commit: e88dcea
▶️ Tests: 406460 executed
⚪️ Checks: 26/26 completed

Test Failures

OcspClientTest > simpleOcspQueryTest(String) > [1] https://apple.com (Netty/Handler/Ssl/Ocsp in Build PR / windows-x86_64-java11-boringssl)
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Connection to OCSP Responder Failed
	at io.netty.util.concurrent.DefaultPromise.get(DefaultPromise.java:365)
	at io.netty.handler.ssl.ocsp.OcspClientTest.simpleOcspQueryTest(OcspClientTest.java:95)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/java.util.Optional.ifPresent(Optional.java:183)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
Caused by: java.lang.IllegalStateException: Connection to OCSP Responder Failed
	at io.netty.handler.ssl.ocsp.OcspClient.lambda$query$0(OcspClient.java:242)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:604)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:597)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:573)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:506)
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:650)
	at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:643)
	at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:132)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:374)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:390)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:435)
	at io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:388)
	at io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:596)
	at io.netty.channel.nio.NioIoHandler.processSelectedKeysOptimized(NioIoHandler.java:571)
	at io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:512)
	at io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:484)
	at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:274)
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:210)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1214)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: no further information: ocsp.apple.com/17.253.251.6:80
Caused by: java.net.ConnectException: Connection timed out: no further information
	at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:387)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:435)
	at io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:388)
	at io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:596)
	at io.netty.channel.nio.NioIoHandler.processSelectedKeysOptimized(NioIoHandler.java:571)
	at io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:512)
	at io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:484)
	at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:274)
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:210)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1214)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
OcspServerCertificateValidatorTest > connectUsingHttpAndValidateCertificateUsingOcspTest() (Netty/Handler/Ssl/Ocsp in Build PR / windows-x86_64-java11-boringssl)
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:31)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:183)
	at io.netty.handler.ssl.ocsp.OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest(OcspServerCertificateValidatorTest.java:159)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
expected actual
true false

Rerun Controls

Select tests to mute in this pull request:

  • OcspClientTest > simpleOcspQueryTest(String)
  • OcspServerCertificateValidatorTest > connectUsingHttpAndValidateCertificateUsingOcspTest()

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Asthenia0412

Asthenia0412 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

CI Diagnostics (2026-10-19) — Both failures are not actionable from this PR

linux-x86_64-java26 build ❌ — infra flake

Full log: Maven failed at the very start with Could not transfer artifact app.testlens:junit-platform-instrumentation:pom:1.9.4 from/to central ... Network is unreachable. The GitHub Actions runner had no outbound network connectivity to Maven Central when the TestLens setup step ran. Java 25 passes cleanly on the same commit, confirming no actual code/API breakage. Re-running should clear it.

windows-x86_64-java11-boringssl ❌ — network-dependent OCSP test

Failing test module is handler-ssl-ocsp, completely unrelated to this PR's resolver-dns changes. Root cause: OcspClientTest.simpleOcspQueryTest and OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest both hit java.lang.IllegalStateException: Connection to OCSP Responder Failed — an external OCSP network/availability issue on the Windows runner.

Environment notes

Sandbox has Java 25 / Maven 3.9.10 / Gradle 8.14 available, but there's no Java 26 here and we can't reproduce the Windows/OCSP setup. Neither failure points to code in this PR. Recommend re-running both checks — they look like transient flakes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Oct 19, 2026

Copy link
Copy Markdown
Member

@Asthenia0412 can you please sign our ICLA and let me know once done: https://netty.io/s/icla.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Failed DnsCacheEntry for a search-domain expanded host shadows a Successful DnsCacheEntry

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Asthenia0412 @normanmaurer @Gabbo01
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.