quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.4k stars 2.57k forks source link

Netty:LogCleanupFilterBuildItem does not remove a message #40938

Open Karm opened 1 month ago

Karm commented 1 month ago

Describe the bug

I keep encountering:

Build resources:
 - 12.09GB of memory (75.6% of 16.00GB system memory, determined at start)
 - 10 thread(s) (100.0% of 10 available processor(s), determined at start)
01:09:13,109 INFO  [org.jbo.res.res.i18n] RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.quarkus.QuarkusRestApplication
01:09:26,536 WARN  [io.net.res.dns.DnsServerAddressStreamProviders] Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS. Check whether you have a dependency on 'io.netty:netty-resolver-dns-native-macos'

So it seems this doesn't work: NettyProcessor.java#L302

    /**
     * On mac, if you do not have the `MacOSDnsServerAddressStreamProvider` class, Netty prints a warning saying it
     * falls back to the default system DNS provider. This is not a problem and generates tons of questions.
     *
     * @return the log cleanup item removing the message
     */
    @BuildStep
    LogCleanupFilterBuildItem cleanupMacDNSInLog() {
        return new LogCleanupFilterBuildItem(DnsServerAddressStreamProviders.class.getName(), Level.WARN,
                "Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath");
    }

Expected behavior

No warning.

Actual behavior

Warning in the build log.

How to Reproduce?

e.g. build this project: https://github.com/Karm/mandrel-integration-tests/tree/master/apps/quarkus-full-microprofile (patch with quarkus_3.8.x.patch first)

mvn package -Pnative -Dquarkus.version=3.8.4

Output of uname -a or ver

Darwin mandrel-macos-aarch64-1.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020 arm64

Output of java -version

openjdk 21.0.3 2024-04-16 LTS

Quarkus version or git rev

3.8.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.7 (8b094c9513efc1b9ce2d952b3b9c8eaedaf8cbf0) Maven home: /opt/apache-maven-3.9.7 Java version: 21.0.3, vendor: Eclipse Adoptium, runtime: /Users/tester/tmp/mandrel-23.1.3.1-Final/Contents/Home

Additional information

% native-image --version native-image 21.0.3 2024-04-16 OpenJDK Runtime Environment Mandrel-23.1.3.2-dev49b42155870 (build 21.0.3+9-LTS) OpenJDK 64-Bit Server VM Mandrel-23.1.3.2-dev49b42155870 (build 21.0.3+9-LTS, mixed mode)

quarkus-bot[bot] commented 1 month ago

/cc @cescoffier (netty), @franz1981 (netty), @galderz (mandrel), @jponge (netty), @zakkak (mandrel)

geoand commented 1 month ago

So this happens during native image build, correct?

If so, we probably need to augment io.quarkus.runtime.graal.DisableLoggingFeature

Karm commented 1 month ago

@geoand Oh, I see.