【问题标题】:PortUnreachableExceptions spamming log after updating Spring Boot Parent更新 Spring Boot Parent 后 PortUnreachableExceptions 垃圾邮件日志
【发布时间】:2022-01-11 12:54:46
【问题描述】:

spring-boot-parent 版本 2.5.5 升级到 2.6.0 后,我开始在日志中看到这些错误消息:

[INFO] [stdout] 2022-01-11 13:40:01.157 WARN 76859 --- [ udp-epoll-2] i.m.s.reactor.netty.channel.FluxReceive : [6d1243de, L:/127.0.0.1:58160 - R:localhost/127.0.0.1:8125] An exception has been observed post termination, use DEBUG level to see the full stack: java.net.PortUnreachableException: readAddress(..) failed: Connection refused

使用 DEBUG 级别:

[INFO] [stdout] 2022-01-11 13:38:29.733  WARN 76479 --- [    udp-epoll-2] i.m.s.reactor.netty.channel.FluxReceive  : [43aad7ce, L:/127.0.0.1:38108 - R:localhost/127.0.0.1:8125] An exception has been observed post termination
[INFO] [stdout] 
[INFO] [stdout] java.net.PortUnreachableException: readAddress(..) failed: Connection refused
[INFO] [stdout]     at io.micrometer.shaded.io.netty.channel.epoll.EpollDatagramChannel.translateForConnected(EpollDatagramChannel.java:575)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.channel.epoll.EpollDatagramChannel.access$400(EpollDatagramChannel.java:56)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:503)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
[INFO] [stdout]     at io.micrometer.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
[INFO] [stdout]     at java.base/java.lang.Thread.run(Thread.java:833)
[INFO] [stdout] Caused by: io.micrometer.shaded.io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection refused

我在release notes 中找不到太多关于它的信息,除了似乎相关的依赖项升级:

升级到千分尺 1.8.0 #28516

但链接的问题没有提供信息。 Micronaut 自己的 release notes for version 1.8.0 也不是(除了 JVM 崩溃通知,我们确实遇到了 - 升级 Spring Boot 的一个令人惊讶且相当不幸的副作用,但我离题了)

我们不(有意识地)使用 Micrometer,所以我尝试在 application.yml 文件(micrometer.enabled: falseinstrumentation.micrometer.enabled: false)中禁用它,但无济于事。

尽管进行了大量的谷歌搜索(对于错误消息元素的各种排列并在 GitHub 上挖掘代码),我仍然无法找到如何修复此消息,更不用说找出导致它的原因了。

现在我当然可以在日志配置中禁止显示此消息,但我想知道它在此处实际尝试实现的目标,以及它是否对我们的应用程序有用。如果没有,请完全禁用它。

【问题讨论】:

  • 看起来它正在尝试将 UDP 数据包发送到 statsd(端口 8125)。你的类路径上有 Micrometer Statsd 注册表吗?
  • @BoristheSpider 事实上,我愿意!
  • 我能够切换到没有 statsd 的 company starter 版本,并且修复了日志垃圾邮件及其神秘来源。

标签: java spring-boot micrometer


【解决方案1】:

假设您没有使用和配置 statsd,因为它指向 localhost,您可以通过设置禁用它

management.metrics.export.statsd.enabled

假的

【讨论】:

    猜你喜欢
    • 2018-04-08
    • 1970-01-01
    • 2019-02-20
    • 2018-07-12
    • 2016-01-10
    • 2021-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多