From 006a14a75ce684067474299990a4f54eaea64752 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:07:08 +0200 Subject: [PATCH] #3689, #3690: Don't immediately close HAProxy health check --- proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index 6caf30cd..d82173b1 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -30,6 +30,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter private ChannelWrapper channel; private PacketHandler handler; + private boolean healthCheck; public void setHandler(PacketHandler handler) { @@ -96,7 +97,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter channel.setRemoteAddress( newAddress ); } else { - channel.close(); + healthCheck = true; } } finally { @@ -146,7 +147,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter { if ( ctx.channel().isActive() ) { - boolean logExceptions = !( handler instanceof PingHandler ); + boolean logExceptions = !( handler instanceof PingHandler ) && !healthCheck; if ( logExceptions ) {