fix(envd): skip MMDS polling on /init when running outside Firecracker - #3638
Closed
Luckydog691 wants to merge 1 commit into
Closed
Luckydog691 wants to merge 1 commit into
Luckydog691 wants to merge 1 commit into
Conversation
The /init handler unconditionally started the 60s MMDS polling loop even when envd runs with -isnotfc, where no Firecracker MMDS endpoint exists. The futile polls leak dangling in-flight connections, which can break runsc checkpointing. Mirror the guard already used in main.go and skip the polling.
Luckydog691
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
September 15, 2026 09:33
|
We require contributors to sign our Contributor License Agreement, and we don't have @Luckydog691 on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check' |
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.
Problem
envd started with
-isnotfcruns outside Firecracker. The flag is documented as "run outside of Firecracker (skips MMDS poll and HTTP log exporter)", andmain.gocorrectly guards its startup poll withif !isNotFC.The
/inithandler, however, starts the same 60s MMDS polling loop unconditionally. Every attempt opens a TCP connection to169.254.169.254:80; with no MMDS endpoint reachable, the handshake never completes and the connection stays inSYN_SENTfor the whole poll window (visible in/proc/net/tcp).That dangling half-open connection becomes fatal when the sandbox is checkpointed: a gVisor (
runsc) checkpoint taken while such a connection exists panics in the TCP endpoint save path (resetConnectionLockeddereferences a nilsnd/rcv), so checkpointing fails deterministically for the whole poll window.Fix
Mirror the guard
main.goalready applies to its startup poll and skip the MMDS polling in/initwhenisNotFCis set. Firecracker-based deployments are unchanged.Testing
SYN_SENTconnection to169.254.169.254:80is observable for ~60s after/initbefore the change; with the change it never appears.go build ./...andgo test ./internal/api/pass.