Skip to content

fix(orchestrator): suppress warn for filesystem-only memfile resolution#3151

Draft
levb wants to merge 1 commit into
mainfrom
lev-fix-fs-only-memfile-warn
Draft

fix(orchestrator): suppress warn for filesystem-only memfile resolution#3151
levb wants to merge 1 commit into
mainfrom
lev-fix-fs-only-memfile-warn

Conversation

@levb

@levb levb commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Filesystem-only snapshots persist no memfile, so Fetch's memfile resolution always failed — spamming the "failed memfile resolution" warn on every fs-only resume, and (under P2P) with a misleading PeerTransitionedError. Gate the warn on the filesystem_only metadata flag: on resolution failure, check the metadata and record a clear sentinel error consumers already tolerate (reboot resume, scheduling metadata) instead of warning. The check runs only on failure, so the common memory-snapshot path never waits on the metadata download. Rootfs untouched.

Filesystem-only snapshots persist no memfile, so Fetch's memfile resolution
always failed — spamming the "failed memfile resolution" warn on every
fs-only resume, and (under P2P) with a misleading PeerTransitionedError.
Gate the warn on the filesystem_only metadata flag: on resolution failure,
check the metadata and record a clear sentinel error consumers already
tolerate (reboot resume, scheduling metadata) instead of warning. The check
runs only on failure, so the common memory-snapshot path never waits on the
metadata download. Rootfs untouched.
@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
3108 2 3106 8
View the top 2 failed test(s) by shortest run time
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all
Stack Traces | 0.24s run time
=== RUN   TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all
Executing command curl in sandbox il06w1851ofi9z9gahdrc
    sandbox_network_update_test.go:355: Command [curl] output: event:{start:{pid:1111}}
    sandbox_network_update_test.go:355: 
        	Error Trace:	.../api/sandboxes/sandbox_network_out_test.go:78
        	            				.../api/sandboxes/sandbox_network_update_test.go:87
        	            				.../api/sandboxes/sandbox_network_update_test.go:355
        	Error:      	"failed to execute command curl in sandbox il06w1851ofi9z9gahdrc: invalid_argument: protocol error: incomplete envelope: unexpected EOF" does not contain "failed with exit code"
        	Test:       	TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all
        	Messages:   	Expected connection failure message
--- FAIL: TestUpdateNetworkConfig/12_allow_internet_access_false_blocks_all (0.24s)
github.com/e2b-dev/infra/tests/integration/internal/tests/api/sandboxes::TestUpdateNetworkConfig
Stack Traces | 289s run time
=== RUN   TestUpdateNetworkConfig
=== PAUSE TestUpdateNetworkConfig
=== CONT  TestUpdateNetworkConfig
--- FAIL: TestUpdateNetworkConfig (288.87s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Because filesystem-only snapshots do not persist a memfile, they also lack a memfile header in storage. This causes t.memfileHeader.WaitWithContext(ctx) to fail first, setting a generic error on t.memfile and returning early. As a result, the isFilesystemOnly check inside the memfileErr != nil block is bypassed, and the expected errFilesystemOnlyNoMemfile sentinel error is never recorded. To fix this, the isFilesystemOnly check should also be performed when hdrErr != nil in the header resolution block.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +207 to +213
if t.isFilesystemOnly(ctx) {
if err := t.memfile.SetError(errFilesystemOnlyNoMemfile); err != nil {
return fmt.Errorf("failed to set memfile error: %w", err)
}

return nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Because filesystem-only snapshots do not persist a memfile, they also lack a memfile header in storage. This causes t.memfileHeader.WaitWithContext(ctx) to fail first, setting a generic failed to resolve memfile header error on t.memfile and returning early. As a result, the isFilesystemOnly check inside the memfileErr != nil block is bypassed, and the expected errFilesystemOnlyNoMemfile sentinel error is never recorded. To fix this, the isFilesystemOnly check should also be performed when hdrErr != nil in the header resolution block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant