Repository navigation
Conversation
When an NFS-cache flag is on but the cache path is unset, builder.go and cache.go each logged the same WARN on every build/launch/resume (hot path), flooding logs while NFS caching is silently disabled. The path is immutable config, so one line suffices. Add storage.WarnNFSCachePathUnsetOnce (sync.Once) and call it from both sites; message now states caching is disabled. Behavior unchanged. Adds a unit test. Refs e2b-dev#3786
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
November 2, 2026 05:42
This branch has not been deployed
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.
What
When an NFS-cache feature flag is enabled but the cache path is unset, the orchestrator logged
WARN "NFSCache feature flag is enabled but cache path is not set"on the hot path — every template build, sandbox launch, and snapshot resume — while NFS caching is silently disabled. On a dev-default deployment (the threeuse-nfs-*flags default toenv.IsDevelopment()= on) with no cache dir set, this floods the logs with hundreds of identical lines.This emits the warning once per process and makes it state the consequence.
Refs #3786.
How
storage.WarnNFSCachePathUnsetOnce(ctx)inpackages/shared/pkg/storage(already imported by both call sites, which callstorage.WrapInNFSCache), guarded bysync.Once.logger.L().Warn(...)inbuilder.go:304(useNFSCache) andcache.go:1218(useNFSCache) with a call to it.Behavior is unchanged: caching is still disabled in this case; only the log frequency and wording change.
Test
TestWarnNFSCachePathUnsetOncecalls the helper 5× and asserts exactly one warning is emitted (zap observer).go test ./packages/shared/pkg/storage/passes; the orchestrator build/sandbox/template packages build clean.