File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -785,18 +785,12 @@ tickerLoop:
785
785
break tickerLoop
786
786
}
787
787
788
- // Detect terminal/non-recoverable states early and fail fast instead of
789
- // waiting for the full timeout. This covers cases where the container
790
- // was stopped or killed immediately after startup (e.g., by another
791
- // orchestrator cleaning up), leaving it in a non-running state that
792
- // will never transition to running.
788
+ // Fail fast on states that won't become running after startup.
793
789
if json .State != nil {
794
790
status := strings .ToLower (json .State .Status )
795
- // Docker statuses can be: "created", "restarting", "running",
796
- // "removing", "paused", "exited", or "dead".
797
- // Treat exited/dead/removing as terminal. If not running and not
798
- // restarting, and we have a non-zero exit code or an error, also fail.
799
- if status == "exited" || status == "dead" || status == "removing" {
791
+ // Consider exited/dead as terminal. "removing" will surface via
792
+ // inspect error or transition to exited/dead shortly.
793
+ if status == "exited" || status == "dead" {
800
794
return fmt .Errorf ("container entered terminal state before running: %s (exitCode=%d)" , json .State .Status , json .State .ExitCode )
801
795
}
802
796
if ! json .State .Restarting && json .State .ExitCode != 0 {
You can’t perform that action at this time.
0 commit comments