feature: clean up removed game server nodes - #485
Merged
Merged
Conversation
This was referenced Oct 2, 2026
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.
Replaces #471.
Removing a game server node only deletes its
game_server_nodesrow, so its Node, Jobs and volumes stay in the cluster. A new job runs every 5 minutes and cleans them up:A host that is still running re-creates its row on its next ping, so it is never cleaned up. Since the job runs on a schedule, it also cleans up nodes that were removed before this change.
Needs 5stackgg/5stack-panel#638 so the api can delete Nodes. Until then it logs a warning and keeps the Node, and with it the node's volumes.
A host that registers again after the cleanup gets its row and volumes back on its next ping, including the CS:GO volume.
Testing
Unit tests, plus two runs against a real k3s in Docker: the first deleted the removed Node and the leftovers of a node with no row and no Node, and the second deleted the volumes of the Node removed in the first run.