Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Server reacts badly to any packets from client-side after shutdown process begins, preemptively dropping connections

Open NIK220V opened this issue 3 years ago • 1 comments

Expected behavior

In the shutdown process, online players should get disconnected exactly when "Notch lost connection: Server closed" appears in console log, not at any point in time before that.

Because of the nature of the early disconnect, proxies (such as BungeeCord) aren't able to handle the disconnect as a server kick, and disconnect the player from the whole network.

Observed/Actual behavior

Players get disconnected almost immediately after the shutdown process begins, and kick messages aren't actually kicking anyone, since players are already disconnected. This is apparently caused by client-side packets that are sent to the server and lead to this issue being reproduced: https://bugs.mojang.com/browse/MC-142590

Steps/models to reproduce

For vanilla:

  1. Fly up, begin falling down
  2. Type /stop while falling down
  3. Get "Disconnected", instead of "Server closed" Custom:
  4. Using any plugin, delay full shutdown for a couple seconds (like using Thread.sleep in onDisable)
  5. Observe time difference between players being dropped with "Disconnected" and actual kicks in console for "Server closed"

Plugin and Datapack List

Doesn't matter

Paper version

[07:00:05 INFO]: This server is running Paper version git-Paper-199 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 77a50b9) You are 7 version(s) behind

Other

Link to the discord talk: https://discord.com/channels/289587909051416579/289587909051416579/1029582828243005520 Video showcasing the problem: https://cdn.discordapp.com/attachments/289587909051416579/1029584461668548728/paper_shutdown.mp4

NIK220V avatar Oct 12 '22 04:10 NIK220V

Can reproduce as of 1.19.2

Owen1212055 avatar Oct 26 '22 21:10 Owen1212055