You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our server had a power outage event, losing internet.
While it was cleanly shutting down on UPS power, it hung indefinitely waiting for the discarpet bot to terminate (or whatever term is apt here).
I suspect that this is a narrow edge case in the shutdown code of the mod, where it doesn't account for not having API access.
Ultimately, no harm was done. The world was saved and database queues emptied securely. I was able to send a SIGINT to kill the server without consequence. Addressing this issue would just help to simplify a secure shutdown when internet is lost.
The text was updated successfully, but these errors were encountered:
So the problem is that javacord's reconnect mechanism repeatedly schedules reconnect attemps, which keep the JVM running. The thread pool those are ran in gets shut down on disconnect when the websocket disconnects. But the websocket already disconnected in this case if the network closed before discarpet disconnects it.
Javacord does account for this by also scheduling a forced shutdown of the thread pool after 1 minute, so in theory one minute after server shutdown, it should close normally. But since you mentioned having to kill it manually sounds like it hung longer than a minute?
I could add some code that if the websocket is already disconnected, it shuts down the thread pool directly, but I'm not certain this wouldn't create issues.
This does sound like a risky situation to address. Shutting down "active" thread pools is always a scare. I suppose if the thread pool can be asserted to only contain reconnect attempts which have no side effect otherwise, it should be safe in theory to terminate the pool and leave its work forfeit.
Though I'd sooner want to figure out why the 1 minute back-off timer didn't work. That smells of an issue elsewhere.
In the end do as you see wisest. I'm just musing aloud haha.
Thank you for investigating this trivial problem!
Our server had a power outage event, losing internet.
While it was cleanly shutting down on UPS power, it hung indefinitely waiting for the discarpet bot to terminate (or whatever term is apt here).
I suspect that this is a narrow edge case in the shutdown code of the mod, where it doesn't account for not having API access.
Ultimately, no harm was done. The world was saved and database queues emptied securely. I was able to send a SIGINT to kill the server without consequence. Addressing this issue would just help to simplify a secure shutdown when internet is lost.
The text was updated successfully, but these errors were encountered: