titivermeesch / CommandTimer

Probably the most complete command scheduling plugin for Spigot
https://www.spigotmc.org/resources/command-timer-easy-gui.24141/
26 stars 9 forks source link

When an operator enters the server, the server main process unexpectedly enters a WAITING state until the server crashes #282

Closed winup-zhou closed 1 month ago

winup-zhou commented 1 month ago

Server Information:

Problem Description:

When a player enters as a non-operator, the server works fine.
However, when the player enters as an operator, the client gets stuck on the "Joining the world" page and after a while it says that the connection timed out.
At this time the server console starts reporting "The server has not responded for 10 seconds! Creating thread dump".

[20:01:46] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - 1.20.6-148-20f5165 (MC: 1.20.6) ---
[20:01:46] [Paper Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[20:01:46] [Paper Watchdog Thread/ERROR]: ------------------------------
[20:01:46] [Paper Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[20:01:46] [Paper Watchdog Thread/ERROR]: Handling packet for connection: net.minecraft.server.network.ServerConfigurationPacketListenerImpl@45f40a09
[20:01:46] [Paper Watchdog Thread/ERROR]: ------------------------------
[20:01:46] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
[20:01:46] [Paper Watchdog Thread/ERROR]:   PID: 37 | Suspended: false | Native: false | State: WAITING
[20:01:46] [Paper Watchdog Thread/ERROR]:   Stack:
[20:01:46] [Paper Watchdog Thread/ERROR]:       java.base@21.0.4/java.lang.Object.wait0(Native Method)
[20:01:46] [Paper Watchdog Thread/ERROR]:       java.base@21.0.4/java.lang.Object.wait(Object.java:366)
[20:01:46] [Paper Watchdog Thread/ERROR]:       java.base@21.0.4/java.lang.Thread.join(Thread.java:2078)
[20:01:46] [Paper Watchdog Thread/ERROR]:       java.base@21.0.4/java.lang.Thread.join(Thread.java:2154)
[20:01:46] [Paper Watchdog Thread/ERROR]:       commandtimer-java21.jar//me.playbosswar.com.updater.Updater.waitThread(Updater.java:165)
[20:01:46] [Paper Watchdog Thread/ERROR]:       commandtimer-java21.jar//me.playbosswar.com.updater.Updater.getResult(Updater.java:66)
[20:01:46] [Paper Watchdog Thread/ERROR]:       commandtimer-java21.jar//me.playbosswar.com.events.JoinEvents.onJoin(JoinEvents.java:21)
[20:01:46] [Paper Watchdog Thread/ERROR]:       com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor4.execute(Unknown Source)
[20:01:46] [Paper Watchdog Thread/ERROR]:       org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77)
[20:01:46] [Paper Watchdog Thread/ERROR]:       co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81)
[20:01:46] [Paper Watchdog Thread/ERROR]:       org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[20:01:46] [Paper Watchdog Thread/ERROR]:       io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[20:01:46] [Paper Watchdog Thread/ERROR]:       io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131)
[20:01:46] [Paper Watchdog Thread/ERROR]:       org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:347)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleConfigurationFinished(ServerConfigurationPacketListenerImpl.java:153)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:22)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:13)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.network.protocol.PacketUtils$$Lambda/0x00007fd9a97ebc48.run(Unknown Source)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.TickTask.run(TickTask.java:18)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
[20:01:46] [Paper Watchdog Thread/ERROR]:       net.minecraft.server.MinecraftServer$$Lambda/0x00007fd9a8c0e040.run(Unknown Source)
[20:01:46] [Paper Watchdog Thread/ERROR]:       java.base@21.0.4/java.lang.Thread.runWith(Thread.java:1596)
[20:01:46] [Paper Watchdog Thread/ERROR]:       java.base@21.0.4/java.lang.Thread.run(Thread.java:1583)
[20:01:46] [Paper Watchdog Thread/ERROR]: ------------------------------
[20:01:46] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---
[20:01:46] [Paper Watchdog Thread/ERROR]: ------------------------------

The server then shuts itself down.
Remove the CommandTimer plugin and the problem no longer occurs.

Server logs:

Paper 1.20.6 Server Log #5BzSSCa

Steps to reproduce the problem:

  1. Configure the server according to the environment described above.
  2. Start the server.
  3. A non-operator player enters the server.
  4. The player is set as an operator and exits the server.
  5. The player tries to enter the server again as an operator.
  6. The problem occurs.
winup-zhou commented 1 month ago

According to my analysis, the plugin's process of checking for updates may have interrupted the server's main process (the process was kept in a waiting state), which ultimately caused Paper's watchdog process to alert. I manually built the PR mentioned above and found that it may have solved my problem.