File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 55 "os"
66 "strings"
77 "sync"
8+
9+ "github.com/jetkvm/kvm/internal/supervisor"
810)
911
1012const (
@@ -78,6 +80,10 @@ func checkFailsafeReason() {
7880
7981 // TODO: read the goroutine stack trace and check which goroutine is panicking
8082 failsafeModeActive = true
83+ if strings .Contains (failsafeCrashLog , supervisor .FailsafeReasonVideoMaxRestartAttemptsReached ) {
84+ failsafeModeReason = "video"
85+ return
86+ }
8187 if strings .Contains (failsafeCrashLog , "runtime.cgocall" ) {
8288 failsafeModeReason = "video"
8389 return
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
1515 "time"
1616
1717 "github.com/Masterminds/semver/v3"
18+ "github.com/jetkvm/kvm/internal/supervisor"
1819 "github.com/jetkvm/kvm/internal/utils"
1920 "github.com/rs/zerolog"
2021)
@@ -422,7 +423,7 @@ func (p *NativeProxy) restartProcess() error {
422423 logger := p .logger .With ().Uint ("attempt" , p .restarts ).Uint ("maxAttempts" , p .options .MaxRestartAttempts ).Logger ()
423424
424425 if p .restarts >= p .options .MaxRestartAttempts {
425- logger .Fatal ().Msg ("max restart attempts reached, exiting" )
426+ logger .Fatal ().Msgf ("max restart attempts reached, exiting: %s" , supervisor . FailsafeReasonVideoMaxRestartAttemptsReached )
426427 return fmt .Errorf ("max restart attempts reached" )
427428 }
428429
Original file line number Diff line number Diff line change 66 ErrorDumpDir = "/userdata/jetkvm/crashdump" // The error dump directory is the directory where the error dumps are stored
77 ErrorDumpLastFile = "last-crash.log" // The error dump last file is the last error dump file
88 ErrorDumpTemplate = "jetkvm-%s.log" // The error dump template is the template for the error dump file
9+
10+ FailsafeReasonVideoMaxRestartAttemptsReached = "failsafe::video.max_restart_attempts_reached"
911)
You can’t perform that action at this time.
0 commit comments