Configurable shutdown and restart process#8152
Closed
Lulu13022002 wants to merge 2 commits into
Closed
Conversation
52844de to
b44e306
Compare
Member
Perhaps then this should be documented? And if we don't want plugins using the watchdog exit code, perhaps log when a plugin does this? See StackWalkerUtil to get the caller plugin |
b44e306 to
3078e9b
Compare
Warriorrrr
reviewed
Sep 8, 2023
Comment on lines
+98
to
+105
| + // Paper - extract method and cleanup | ||
| + addRawShutdownHook(onExit); | ||
| + System.out.println("Attempting to restart with a plugin custom hook"); | ||
| + // Stop the watchdog | ||
| + WatchdogThread.doStop(); | ||
| + | ||
| + shutdownServer(true); | ||
| + // Paper end |
Member
There was a problem hiding this comment.
Forgot to remove a sysout here, also paper comments inside paper comments
| + public boolean lagCompensateBlockBreaking = true; | ||
| + public boolean useDimensionTypeForCustomSpawners = false; | ||
| + public boolean strictAdvancementDimensionCheck = false; | ||
| + public boolean predictShellOnRestart = true; |
Member
There was a problem hiding this comment.
I'm wondering whether it might be nice to have a system property for this instead of an option so that it can be set by hosts, though I doubt many of them use the restart command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7446
This allow more flexibility for plugins to restart or shutdown the server with other external app:
Exit the process with a non zero exit code (also plugin should avoid the 70 exit code already used for watchdog)
=> server.abnormalShutdown(exitCode)
Restart the process without a script but using a runnable this allow plugin to do more things without adding a new shutdown hook. Also plugin can easier choose the right executing order
=> server.restart(() ->...)
Keep in mind that theses functions must be called on the main thread (to avoid background process, data loss and file lock).
Also i have added a new config option: predictShellOnRestart (true by default)
By default when server restart spigot predict which shell will be used for windows and "others" but this behavior can cause some trouble in container or when the predicted shell is not available for X reason