SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.57k stars 1.1k forks source link

HAProxy layer 7 health-check not possible anymore #3689

Closed Packsolite closed 3 months ago

Packsolite commented 4 months ago

Bungeecord version

52ab21b1ffcde905bad2a65e98d82424b72826c4

Server version

any

Client version

any

Bungeecord plugins

any

The bug

So this commit broke the HAProxy Layer 7 check: https://github.com/SpigotMC/BungeeCord/commit/6e1751733f6b3dafe824dcd7f00d5ed86572ba37

Before this commit, we could use a legacy proxy ping to make sure a Bungee instance is up & healthy:

 check-send-proxy check
        option tcp-check
        tcp-check send-binary fe
        tcp-check expect binary ff

This no longer seems possible, as the proxy now closes the connection, resulting in HAProxy marking the server as offline. image

Log output (links)

none

Checking

Outfluencer commented 4 months ago

are you checking by legacy pings/handshakes?

Packsolite commented 4 months ago

are you checking by legacy pings?

As clearly stated in the issue report, yes.

Outfluencer commented 4 months ago

why is that needed, i think the connection accept threads are the same as the one handling the legacy ping, if one works the other should also

as we dont have a worker and boss group

Packsolite commented 4 months ago

why is that needed, i think the connection accept threads are the same as the one handling the legacy ping, if one works the other should also

One could argue that it's a "cleaner" solution to not just check if the layer 4 tcp connection is accepted, but if you can actually stream useful data from it. This way you could even use the response as a factor for load balacing and stuff. I don't see a reason why you would change it from the previous behaviour...

Outfluencer commented 4 months ago

because of this https://github.com/SpigotMC/BungeeCord/issues/3608

Packsolite commented 4 months ago

because of this #3608

If you send a legacy ping there is no log entry at all. You could also do a handshake and gracefully close the connection from HAProxy. The currently applied fix seems like a dirty solution to me :/

Outfluencer commented 4 months ago

done

didn't know ha proxy has the option to send custom data

Packsolite commented 3 months ago

Any updates on this? Would be nice to have this resolved for the 1.21 release.

Outfluencer commented 3 months ago

I created a pr, that i think fixes this issue. You need to wait for md_5 to review it and maybe merge it.

Outfluencer commented 3 months ago

Should be fixed now @Packsolite please try it with the latest build

Packsolite commented 3 months ago

Should be fixed now @Packsolite please try it with the latest build

image

Can confirm it working again.

Thanks for the quick fix!