Restart instances that crash after running for 10 minutes

Adds instance.restart_after_crash (default off) and
instance.crash_retry_attempts (default 3, 0 for no limit). The host only
restarts an instance that ran for at least 10 minutes before exiting
unexpectedly, so a boot loop stops after one crash. A user stop, kill or
restart resets the count; it is not persisted across host restarts.

Closes #1251

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-11-21 15:55:28 +00:00
1 parent 7a2aade25b
commit 565e931a96
5 files changed
+142 -1

No files matched your search

+2
View File
@@ -351,6 +351,8 @@ export default class Host extends lib.Link {
_shuttingDown = false;
/** Instances waiting on {@link Instance.fromConfig} */
_startingInstances = new Set<number>();
/** Restarts after a crash per instance ID since the last manual stop */
_crashRetryAttempts = new Map<number, number>();
startedAtMs = Date.now();