Conversation
Restarts hosts, and optionally the controller, that report a pending restart once no players have been online for a configurable time. Only loaded on the controller: it counts players from the users online on running instances, sends HostRestartRequest through the existing core path, and starts the instances that were running once the host reports back. Each host process is asked at most once, keyed on its process start time, so a stale system info poll cannot trigger a second restart. Uses the function-style entrypoint clusterio now documents, so it loads without the deprecated class export warning. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 17, 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.
Adds
exp_auto_restart(@expcluster/auto-restart), a controller-only plugin that restarts hosts, and optionally the controller, which report "Restart Required" once no players have been online for a configurable time.How it works. Every 10 s it walks the controller's system info. A connected host with
restartRequiredandcanRestartwhose running instances have had no players forexp_auto_restart.idle_secondsgetsHostRestartRequest, the same request the web UI button sends. Players are counted from the users online on instances with statusrunning, so stale online sets after a host crash do not hold anything back. When the host reconnects and reports its instances, the ones that were running are started again; instances withinstance.auto_startare left to the host. Each host process is asked at most once, keyed on its process start time, so a stale system info poll cannot trigger a second restart. A refusal from the host (no--can-restart, downgrade) is logged once and not retried, transport errors retry on the next check.Config, all on the controller:
idle_seconds(300),scope(hostorcluster, whether players on other hosts also hold back a restart),start_instances(true),restart_controller(false, restarts the controller when the whole cluster is idle, after the same downgrade check the web UI does).It uses the function-style default export that clusterio master now documents, so it loads without the "deprecated class export" warning the other plugins get.
Testing. 53 tap assertions around a real
ControllerwithsendTostubbed: idle tracking, the idle threshold, once per process,canRestartfalse, cluster scope, refusal versus transport errors, instance restart after reconnect, pending expiry, and the controller path. Smoke tested in a standalone dev cluster with a host in a restart loop and a Factorio 2.1.19 instance: after a restart-required config change the host was restarted once the idle time passed, came back in 2 s and the instance was started again, with no second restart.Notes.
maindoes not build against clusterio master since clusterio/clusterio@7122cbcc (typed hook system). exp_rolesweb/index.tsxfails onPluginExtensionPropsand exp_scenario oncontroller.plugins, so Node CI will be red until that is caught up.🤖 Generated with Claude Code