mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-30 04:01:55 +01:00
Exit with non-zero exit code when killed by watchdog (#5732)
This commit is contained in:
parent
8c6e42583a
commit
e278cc1a3a
@ -100,6 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// Spigot end
|
||||
|
||||
+ public volatile Thread shutdownThread; // Paper
|
||||
+ public volatile boolean abnormalExit = false; // Paper
|
||||
+
|
||||
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@ -261,10 +262,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
//this.remoteStatusListener.b(); // Paper - don't wait for remote connections
|
||||
}
|
||||
|
||||
- System.exit(0); // CraftBukkit
|
||||
+ hasFullyShutdown = true; // Paper
|
||||
System.exit(0); // CraftBukkit
|
||||
+ System.exit(this.abnormalExit ? 70 : 0); // CraftBukkit // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@Override
|
||||
public void stop() {
|
||||
@ -579,6 +582,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ RestartCommand.addShutdownHook( SpigotConfig.restartScript );
|
||||
+ }
|
||||
+ // try one last chance to safe shutdown on main incase it 'comes back'
|
||||
+ server.abnormalExit = true;
|
||||
+ server.safeShutdown(false, restart);
|
||||
+ try {
|
||||
+ Thread.sleep(1000);
|
||||
|
Loading…
Reference in New Issue
Block a user