Skip to content

fix(fc): use "dead" status, not "stopped", for a reboot-killed microVM - #955

Merged
cdalar merged 1 commit into
mainfrom
fix/fc-dead-status-not-paused
Jul 8, 2026
Merged

cdalar merged 1 commit into
mainfrom
fix/fc-dead-status-not-paused

Conversation

@cdalar

@cdalar cdalar commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #954. After that PR merged, a live report from onctl -p fc ls on fc-hel1-01 (rebooted for a kernel upgrade) showed the orphaned microVM as paused β€” still wrong, just a different wrong status than before.

Root cause: #954's reconciliation persists a dead fc microVM's status as "stopped". But cmd/list.go's isPausedStatus() already treats the literal string "stopped" as the cross-provider paused/resumable convention:

func isPausedStatus(status string) bool {
	return status == "stopped" ||
		status == "TERMINATED" ||
		strings.Contains(strings.ToLower(status), "deallocated")
}

That's correct for AWS/GCP/Azure β€” a "stopped" EC2 instance or "deallocated" Azure VM still exists and can be resumed. It's not correct for fc: a microVM whose firecracker process died (e.g. host reboot) has no restart-from-disk β€” recovering it means destroy + recreate. Reusing "stopped" collided with that check and folded the dead microVM into onctl ls's PAUSED section, implying resumability it doesn't have β€” the exact kind of lie this whole fix exists to stop.

Changes

  • Renames fcStatusStopped β†’ fcStatusDead ("dead") throughout pkg/cloud/fc.go and the fc-specific duplicate-name check in cmd/create.go.
  • Adds TestIsPausedStatus in cmd/list_test.go covering the AWS/GCP/Azure paused strings (true) alongside fc's "dead" (false), to lock in the distinction and catch any future status-string collision here.

Test plan

  • go build ./...
  • go vet ./...
  • golangci-lint run ./cmd/... ./pkg/cloud/... β€” 0 issues
  • go test ./pkg/cloud/... -run TestProviderFC β€” all passing (renamed assertions)
  • go test ./cmd/... -run "TestIsPausedStatus|TestListCmd" β€” all passing, including the new regression test

PR #954's reconciliation persisted a dead fc microVM's status as
"stopped" β€” but cmd/list.go's isPausedStatus() already treats the
literal string "stopped" as the cross-provider paused/resumable
convention (AWS "stopped", GCP "TERMINATED", Azure "deallocated") and
folds it into onctl ls's PAUSED section. That collision made a
reboot-killed microVM (no restart-from-disk, must be destroyed and
recreated) render as merely "paused" (implying it can be resumed),
which is exactly what this fix was supposed to stop lying about.

Renames fcStatusStopped to fcStatusDead ("dead") throughout pkg/cloud
and the cmd/create.go duplicate-name check, and adds
TestIsPausedStatus in cmd/list_test.go to lock in the distinction.
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
βœ… Project coverage is 24.21%. Comparing base (9ba7d86) to head (b11d445).

Files with missing lines Patch % Lines
cmd/create.go 0.00% 1 Missing ⚠️
pkg/cloud/fc.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #955      +/-   ##
==========================================
+ Coverage   24.12%   24.21%   +0.09%     
==========================================
  Files          44       44              
  Lines        4440     4440              
==========================================
+ Hits         1071     1075       +4     
+ Misses       3235     3231       -4     
  Partials      134      134              

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdalar
cdalar merged commit 5dbb06e into main Jul 8, 2026
15 checks passed
@cdalar
cdalar deleted the fix/fc-dead-status-not-paused branch July 8, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 捒网址