Repository navigation
chore(experimental): rebase onto the new stable (upstream 1cea50fcb) - #17
Merged
Merged
Conversation
tiago-mitralab
force-pushed
the
sync/2026-10-19/experimental
branch
3 times, most recently
from
October 21, 2026 22:28
a84c135 to
1e37e55
Compare
tiago-mitralab
force-pushed
the
experimental
branch
from
October 23, 2026 02:20
afd964b to
1e37e55
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase of
experimentalonto the newstable(#16, upstream1cea50fcb), with the cherry-pick series curated against what upstream merged in the last five weeks. 13 commits become 7, plus one Mitra fix on top (below).How to review. The series on top of the new
stable: sync/2026-10-19/stable...sync/2026-10-19/experimentalHow it lands. Force-push after approval, like
stable(backup tagexperimental-before-upstream-sync-2026-10-19atafd964b72).Dropped, and why
9aa6edd8f67b318240carries the identical change toservice.go(diffed line by line), even though e2b-dev#3099 is still open1330d8768Cleanup(Add after run drops the function)9cc9ca757(2026-10-07) keeps the state check and the registration under the same lock asRun, and runs late cleanups throughrunLateCleanupoutside the lock. That covers the TOCTOU this commit fixedace2e0a61607329576t.Parallel()incleanup_test.go1330d8768added03dd79359stable(#12), same contentafd964b72E2B_DEBUGfor the sandbox logger (#15)stable(#14), same contentThe four removed cherry-picks stay reachable from the backup tag.
Kept, with the check that says they are still needed
1cea50fcbTODO: If the handle function fails, we should kill the sandboxis still atuffd.go:132to toblock/cache.go:480t.Parallel()inuffd_test.goWaitForExit, plus its testsWaitForExitupstream; e2b-dev#3194 was declined there ("keep the sandbox TTL handling on API level only"), kept on purpose because a cell has a single APIContext.EnvVarsat build (phases/base/builder.go) but never merges them into the sandbox confignsenterinstead ofip netns exec(e2b-dev#3037)fc/process.gostill usesip netns exec; e2b-dev#3037 still openMitra fix on top of the cherry-picks
fix(orchestrator): node TTL is a backstop past the end time, stopping as killedis our own commit, on top of the seven so they stay byte-identical for patch-id absorption:WaitForExitcherry-pick) fired at the end time, the same moment the API evictor acts, and calledStopwith no stop reason. So a sandbox the API meant to pause (auto-pause) could be killed first, since the node does not know about auto-pause, and every expiry read as a crash (ERROR,crashedlabel, per-team crash counter from44932b67e).nodeTTLGrace(2 min) past the end time: with the API up, the evictor decides pause or kill on time and the node only acts when the API never did.WaitForExitreturnsErrSandboxTTLExpired, the lifecycle recordsStopReasonKilledand logs at Info, and when the timer and the Firecracker exit are ready together the exit wins, so a crash never reads as a TTL. Tests pin the expiry to end time plus grace and fail with the grace removed or doubled.394ed9413classified a stop during accept or handshake as benign. The log now follows the classification.Open decision: the grace against the pause-refusal path. When the node refuses a pause (disk or dedup in flight), the API puts the sandbox back to running and retries every 10 s, and only degrades to a filesystem-only pause after
AutoPauseOverstayBudgetMs(120 s by default) from the first refusal. A 2 min grace from the end time can kill it just before that. This needs two opt-ins our fleet does not have today: no host setsPAUSE_REFUSAL_RESTORE(default off), and nomitra-sandboxcaller asks for pause on timeout (code_runner_pool.py:569passeskill; native pause left with mitra-sandbox#380). Options: keep 2 min and revisit when either is turned on; raise the grace to cover budget, retries andpauseTimeout(about 5 min); or have the node push its own deadline while it is answering a pause with ResourceExhausted. The last one is the correct fix, and a bigger change than this PR.Left as is, on purpose.
env_vars_test.gotests a copy of the merge, not production code, and the merge exists twice (server/sandboxes.go,sandbox/reboot.go);uffd_test.gohas an empty assertion (SetsHandlerError). Fixing them means editing the cherry-picks; better sent upstream to e2b-dev#3148 and e2b-dev#3132.Proof
Run on
tiago-dev(x86_64, kernel 7.0) with the fleet toolchain, Go 1.26.8 (GOTOOLCHAIN=go1.26.8), on theexperimentaltip, which contains the wholestableseries:go build ./...andgo vet ./...clean in all 12 modules ofgo.work;go vetalso clean on thestabletip alone (orchestrator, api, client-proxy, shared, envd).go mod tidyleaves no diff in orchestrator, shared and api on thestabletip.go test -count=1 ./...in every module, against localpostgres:18-alpineandredis:8-alpineexported asPG_TEST_DATABASE_URLandREDIS_TEST_DATABASE_URL(what upstream CI does since 2026-10-18), withTZ=UTC. Theuserfaultfdandcore/ocisuites rerun undersudo -E, as they needuserfaultfdandunshare. All green, except three packages that need what this machine does not have:orchestrator/pkg/sandbox/rootfs(TestUblk_*): needs root andublk_drv. Deliberately not run here, because loading ublk on a kernel 7.0 host that serves other work is exactly what hungsf-2in October. These run one2b-devbefore the rollout.envd/internal/services/filesystem(two FUSE tests):bindfsnot installed here.orchestrator/pkg/serverTestUpdateTracksWorkWhileLockedAndPublishingfails only outside UTC (the host is on America/Sao_Paulo); passes withTZ=UTC. Upstream test, not touched by this series.Not done yet, and gated on an explicit go: build and the ublk suites on
e2b-dev, bootstrap, template rebuild with envd 0.10.0 and the load test ladder frommitra-dev.🤖 Generated with Claude Code