Skip to content

Commit eeba2aa

Browse files
bchaliosclaude
authored andcommitted
fix(orchestrator): remove the fs-only pause version gate
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> GitOrigin-RevId: 3ecf45739f605b97a6b9a4f3cfd1477d76ac3a49
1 parent 126fc77 commit eeba2aa

3 files changed

Lines changed: 12 additions & 100 deletions

File tree

‎packages/orchestrator/pkg/server/fc_version_gate_test.go‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ import (
1212
"github.com/e2b-dev/infra/packages/shared/pkg/fcversion"
1313
)
1414

15-
// TestFirecrackerSupports pins the server-side version gate for the E2B
16-
// snapshot feature set: only e2b-format releases >= 0.2.0 qualify; legacy
17-
// _hash builds — including dev builds that mechanically carry the endpoints —
18-
// and unparsable versions fail CLOSED. The gate feeds two call sites with
19-
// different failure modes (in-place checkpoint falls back to resume-fresh;
20-
// a filesystem-only pause is refused), so it must never err toward true.
15+
// TestFirecrackerSupports pins what the wrapper adds over the fcversion
16+
// predicates (whose floors sandbox_features_test.go owns): it reads the
17+
// RUNNING version off the sandbox config, and an unparsable version fails
18+
// CLOSED — a version-gated feature must never engage on a build outside the
19+
// release contract.
2120
func TestFirecrackerSupports(t *testing.T) {
2221
t.Parallel()
2322

@@ -33,13 +32,10 @@ func TestFirecrackerSupports(t *testing.T) {
3332
cases := []struct {
3433
version string
3534
inPlace bool
36-
fsOnly bool
3735
}{
38-
{"v1.14-0.2.0", true, true},
39-
{"v1.14-1.0.0", true, true},
40-
{"v1.14-0.1.1", false, true}, // fs-only ships from 0.1.0; in-place needs the 0.2.0 balloon API
41-
{"v1.14.1_6ecb627", false, false}, // legacy build carrying the endpoints: still refused
42-
{"garbage", false, false}, // unparsable: fail closed
36+
{"v1.14-0.2.0", true},
37+
{"v1.14.1_6ecb627", false}, // legacy build carrying the endpoints: still refused
38+
{"garbage", false}, // unparsable: fail closed
4339
}
4440

4541
for _, tc := range cases {
@@ -49,8 +45,6 @@ func TestFirecrackerSupports(t *testing.T) {
4945
sbx := mkSbx(tc.version)
5046
assert.Equal(t, tc.inPlace,
5147
firecrackerSupports(t.Context(), sbx, "in-place checkpoint", (*fcversion.Info).HasInPlaceCheckpoint))
52-
assert.Equal(t, tc.fsOnly,
53-
firecrackerSupports(t.Context(), sbx, "filesystem-only snapshot", (*fcversion.Info).HasFilesystemSnapshots))
5448
})
5549
}
5650
}

‎packages/orchestrator/pkg/server/pause_gate_test.go‎

Lines changed: 0 additions & 70 deletions
This file was deleted.

‎packages/orchestrator/pkg/server/sandboxes.go‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,10 @@ func (s *Server) Create(ctx context.Context, req *orchestrator.SandboxCreateRequ
413413
ClientId: s.info.ClientId,
414414
SchedulingMetadata: schedulingMetadata,
415415
FilesystemBootApplied: filesystemBooted,
416-
// The version the sandbox actually runs, frozen for its lifetime:
417-
// version-gated callers (the API's fs-only pre-checks) must read
418-
// this instead of re-resolving, which can disagree with the frozen
419-
// value whenever the flag moves.
416+
// The resolved Firecracker version the sandbox actually runs, frozen
417+
// for its lifetime. The API stores it so a version-gated feature can
418+
// key off the running binary exactly instead of re-resolving the
419+
// flag, which drifts from this frozen value whenever the flag moves.
420420
ResolvedFirecrackerVersion: resolvedFCVersion,
421421
}, nil
422422
}
@@ -834,18 +834,6 @@ func (s *Server) Pause(ctx context.Context, in *orchestrator.SandboxPauseRequest
834834
telemetry.WithEnvdVersion(sbx.Config.Envd.Version),
835835
)
836836

837-
// Version-gate filesystem-only snapshots BEFORE MarkStopping, while the
838-
// sandbox is still fully live: producing one is part of the e2b release
839-
// contract from 0.1.0, and silently taking a memory snapshot instead
840-
// would betray an explicit memory:false. The API pre-checks this before
841-
// committing its pause chain, so reaching here means a stale client or a
842-
// direct gRPC caller; FailedPrecondition names the real cause either way.
843-
if in.GetFilesystemOnly() && !firecrackerSupports(ctx, sbx, "filesystem-only snapshot", (*fcversion.Info).HasFilesystemSnapshots) {
844-
return nil, status.Errorf(codes.FailedPrecondition,
845-
"filesystem-only snapshots require an e2b firecracker release (>= 0.1.0); sandbox '%s' runs %q",
846-
in.GetSandboxId(), sbx.Config.FirecrackerConfig.FirecrackerVersion)
847-
}
848-
849837
marked := s.sandboxFactory.Sandboxes.MarkStopping(ctx, sbx.Runtime.SandboxID, sbx.LifecycleID)
850838
if !marked {
851839
telemetry.ReportCriticalError(ctx, "failed to mark sandbox as stopping", nil, telemetry.WithSandboxID(in.GetSandboxId()))

0 commit comments

Comments
 (0)