PaperMC/paper-server/patches/sources/net/minecraft/server
Zach Brown 2f74bdb56b Properly handle async calls to restart the server
The watchdog thread calls the server restart function asynchronously. Prior to
this change, it attempted to do several non-safe operations from the watchdog
thread, rather than the main. Specifically, because of a separate upstream change,
it causes player entities to be ticked asynchronously, among other things.

This is dangerous.

This patch moves the old handling into a synchronous variant, for calls from the
restart command, and adds separate handling for async calls, such as those from
the watchdog thread.

When calling from the watchdog thread, we cannot assume the main thread is in a
tickable state; it may be completely deadlocked. In order to handle this, we mark
the server as stopping, in order to account for situations where the server should
complete a tick reasonbly soon, i.e. 99% of cases.

Should the server not enter a state where it is stopping within 10 seconds, We
will assume that the server has in fact deadlocked and will proceed to force
kill the server.

This modification does not force restart the server should we actually enter a
deadlocked state where the server is stopping, whereas this will in most cases
exit within a reasonable amount of time, to put a fixed limit on a process that
will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss.
2017-05-12 23:34:11 -05:00
..
bossevents Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
commands Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
dedicated Add setting for proxy online mode status 2016-08-05 01:03:08 +02:00
gui Use TerminalConsoleAppender for console improvements 2017-06-09 19:03:43 +02:00
level ExperienceOrbs API for Reason/Source/Triggering player 2017-12-19 16:31:46 -05:00
network Properly fix item duplication bug 2016-12-27 01:57:57 +00:00
packs Build system changes 2016-02-29 20:40:33 -06:00
players Properly handle async calls to restart the server 2017-05-12 23:34:11 -05:00
rcon Configurable RCON IP address 2016-04-16 00:39:33 -04:00
Bootstrap.java.patch Paper Plugins 2022-07-06 23:00:31 -04:00
Main.java.patch Paper Plugins 2022-07-06 23:00:31 -04:00
MinecraftServer.java.patch Properly handle async calls to restart the server 2017-05-12 23:34:11 -05:00
PlayerAdvancements.java.patch Configurable Advancement Disabling 2017-06-09 16:29:31 +10:00
ServerAdvancementManager.java.patch Configurable Advancement Disabling 2017-06-09 16:29:31 +10:00
ServerFunctionManager.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
ServerScoreboard.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
ServerTickRateManager.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
Services.java.patch Paper config files 2022-06-08 22:20:16 -07:00