Expose abnormal exit path to plugins. #10539
Replies: 5 comments
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically closed because it has not had activity in a long time. If the issue still applies to the most recent supported version, please open a new issue referencing this original issue. |
Beta Was this translation helpful? Give feedback.
-
This was a feature, not a bug stale bot... |
Beta Was this translation helpful? Give feedback.
-
Generally we let stale close a feature request if there's no takers of the PR or discussion in 90 days, whether that's good or not I'm not sure |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem?
I have a paper instance operating inside of a wrapper (presumed docker container) provided by a shared hosting provider.
The host offers configuration, as to whether the server should be automatically restarted on crash, and (presumably) keeps track of time since the last crash to prevent crash loops.
It does this via monitoring the exit codes of the various game servers it's able to host.
However it's currently not able to detect whether a plugin induced shutdown is considered normal or abnormal.
It would be useful, if there were a method of communicating shutdown intent, to the wrapper of the server, from plugins.
E.g.
One plugin could offer a
/plannedrestart
command, that would notify users that an upcoming unscheduled but planned restart is about to occur. Once the server is shutdown, the wrapper could recognize there was intent to restart, and restart the server.Another command that could be offered
/emergencystop
which would perform an immediate shutdown of the server, with no intent to restart, and no warning to players, or the same mechanism be invoked within a plugins onEnable if a fatal configuration error had occurred with say, a database connection string for a large minigames network.Describe the solution you'd like.
I would like to see plugins able to call a
Server.abnormalShutdown()
command that would indicate an error state, via an exit code, much like the watchdog is currently able to produce.Also, an ability to call
Server.restart()
which depending on configuration, would either invoke the restart script configured, or if no restart script configured, exit with some form of signalling that a wrapper could pick up on.Whether exitcode
0
is used for for a normal shutdown without restart, or a normal shutdown with restart, or both with some other method of signalling (making sure the last thing posted to thestderr
orstdout
pipe some form of restart sentinel value?)It feels wrong to use a non zero exit code to indicate a non errored shutdown of a process, but maybe there is precedent elsewhere? It certainly would feel like the most natural method of signalling available.
Describe alternatives you've considered.
Spigots
/restart
command is awkward, and slightly re-entrant in that it attempts to start the new process before the old one has ended. It's liable to hit strange and awkward bugs, and doesn't seem to be compatible with how some basic docker containers are configured without a explicit startup script, making assumptions about what shells are installed based on whether the os contains 'win'.Other
No response
Beta Was this translation helpful? Give feedback.
All reactions