Skip to content

UDP Server Spamming Logs #394

Open
Open

Description

@ashtr4l

Description

Poyoraz and I have been investigating an issue present when running the mod on Linux servers causing packets to flood the console and cause lag spikes.

These packets are queries for server metadata (playercount, motd, etc) used by the server list (or server hosts) to display current information about the server.

The reason that these packets are throwing errors is due to Minecraft's Query system from QueryThreadGs4 not initialising correctly, the Epoll system used on Linux cannot handle concurrent access to the same port by multiple services without additional efforts (Namely the SO_REUSEPORT option on channels). The QueryThreadGs4 Class does not have this measure.

As the UDP server is started first and acquires access to the port, the Query system is prevented from acquiring access. All packets that should be caught and handled by this service are instead picked up by the UDP server, which throws errors as it does not recognise what to do with them.

(The query system not initialising can be seen at line 481 in the attached logs)

The two potential fixes would be:

  • Force Minecraft's query system to use the SO_REUSEPORT option.
    • Overriding base Minecraft methods would not be ideal for compatability.
  • Move the UDP server initialisation so that it occurs after the query thread and enable the SO_REUSEPORT option on the channels it opens.
    • In the current UDP Server code, enabling the flag would be achieved by inserting ".option(EpollChannelOption.SO_REUSEPORT, true)" into ServerConnectionListenerMixin.java at lines 70 & 96.

Game Log

https://mclo.gs/fbdtbji

Activity

  1. Poyoraz commented on Apr 22, 2026

    @Poyoraz

    For any end users who are coming across this problem, Connectivity does fix this issue.

  2. Poyoraz commented on Apr 22, 2026

    @Poyoraz

    netty/netty#5799 SO_REUSEPORT also seems to not be available in Bootstrap, although in our tests we didn't get the mentioned error message so some stuff might've changed in the last 10 years

  3. Ocelot5836 commented on Apr 22, 2026

    @Ocelot5836
    Collaborator

    Does fix/udp resolve the issue?

  4. Poyoraz commented on Apr 22, 2026

    @Poyoraz

    Nope, we already tried the same solution in that branch sadly

  5. ashtr4l commented on Apr 22, 2026

    @ashtr4l
    Author

    We tested SO_REUSEPORT while exploring the solutions to the bug, that's where I got the knowledge of the line positions to insert the code.

    SO_REUSEPORT only works to allow access to a port that is already claimed, the UDP server acquires its port access first, so just adding that option doesn't change anything.

    The whole code for initialising the UDP server would need to also be moved / delayed so that it executes after the query system is initialised.

  6. pinned this issue on Apr 22, 2026
  7. ItzLucaGER commented on Apr 29, 2026

    @ItzLucaGER

    For any end users who are coming across this problem, Connectivity does fix this issue.

    Hey how exactly does connectivity fix the issue? Feels like Im missing something because my server still crashes with this error even if the mod is on client and server side

  8. Poyoraz commented on Apr 29, 2026

    @Poyoraz

    For any end users who are coming across this problem, Connectivity does fix this issue.

    Hey how exactly does connectivity fix the issue? Feels like Im missing something because my server still crashes with this error even if the mod is on client and server side

    thats my bad, I am guessing something else was suppressing the issue

  9. ItzLucaGER commented on Apr 29, 2026

    @ItzLucaGER

    For any end users who are coming across this problem, Connectivity does fix this issue.

    Hey how exactly does connectivity fix the issue? Feels like Im missing something because my server still crashes with this error even if the mod is on client and server side

    thats my bad, I am guessing something else was suppressing the issue

    Alrighty no worries, I'll just follow the issue :)

  10. Poyoraz commented on Apr 29, 2026

    @Poyoraz

    if you can take a build, #406 does fix the issue, you would just need to tell all your players to set their config to the same port as well

  11. ItzLucaGER commented on Apr 29, 2026

    @ItzLucaGER

    if you can take a build, #406 does fix the issue, you would just need to tell all your players to set their config to the same port as well

    I did see the PR, however I dont know how to build the jar myself. I'll do some research and try my best though lol

  12. ItzLucaGER commented on Apr 29, 2026

    @ItzLucaGER

    if you can take a build, #406 does fix the issue, you would just need to tell all your players to set their config to the same port as well

    Did get it to work, singleplayer works fine but my server doesn't start with it https://mclo.gs/9tiqGqR

    Edit: I didnt know that Linux ports under 1024 cant be used lol

  13. nick9509 commented on Jul 6, 2026

    @nick9509

    when that will be fixed? it literally drops my TPS

  14. Tresillo2017 commented on Jul 26, 2026

    @Tresillo2017

    I'm having the same issue.

  15. elsandro-tech commented on Jul 28, 2026

    @elsandro-tech

    if you can take a build, #406 does fix the issue, you would just need to tell all your players to set their config to the same port as well

    Did get it to work, singleplayer works fine but my server doesn't start with it https://mclo.gs/9tiqGqR

    Edit: I didnt know that Linux ports under 1024 cant be used lol

    Hi @ItzLucaGER , could you possibly share the .jar file? Im running into the same issue with our server, but am not familiair enough with coding to build the jar myself.

  16. anquietas-sys commented on Sep 28, 2026

    @anquietas-sys

    https://mclo.gs/9Yo0DH2
    I am also experiencing this bug, on the most recent version

  17. Poyoraz commented on Sep 28, 2026

    @Poyoraz

    https://mclo.gs/9Yo0DH2 I am also experiencing this bug, on the most recent version

    the supported "solution" is to disable udp packets in the config

  18. Luviam commented on Oct 5, 2026

    @Luviam

    I Have also ran into this issue. Disabling the UDP pipeline in sable's config works for the time being. Hoping this is fixed soon :P

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions