orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of once

オープン 初心者向け
#3,786 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@AdaAibaby がすでに取り組んでいます。

2026年11月2日 から。

  • #3787 @AdaAibaby による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

issue で挙げられている2つの呼び出し箇所から始めてください。packages/orchestrator/pkg/template/build/builder.go:304 付近の useNFSCache チェックと、packages/orchestrator/pkg/sandbox/template/cache.go:1218 付近のチェックです。提案されているヘルパーは、storage.WrapInNFSCache の隣の packages/shared/pkg/storage に置いてください。完了の条件は、警告がプロセスごとに一度だけ表示されること、キャッシュディレクトリが設定されるまで NFS キャッシュは無効のままであることを警告文が示すこと、そして一度だけ表示される動作を単体テストが検証していることです。

索引モデルが issue の本文から書いたものです。

説明

Summary

When an NFS-cache feature flag is enabled but no cache path is configured, the orchestrator logs WARN "NFSCache feature flag is enabled but cache path is not set" on the hot path — once per template build, per sandbox launch, and per snapshot resume — and NFS caching is silently disabled. On a dev-default deployment this floods the logs (hundreds of identical lines observed) while telling the operator nothing new after the first line.

Why it happens by default

Three flags default to env.IsDevelopment() (i.e. on in dev):

  • use-nfs-for-building-templates (UseNFSCacheForBuildingTemplatesFlag)
  • use-nfs-for-snapshots (SnapshotFeatureFlag)
  • use-nfs-for-templates (TemplateFeatureFlag)

If the shared chunk cache dir is not set (common in a plain dev bring-up), each of the two call sites warns on every operation:

  • packages/orchestrator/pkg/template/build/builder.go:304 (useNFSCache, per build)
  • packages/orchestrator/pkg/sandbox/template/cache.go:1218 (useNFSCache, per launch/resume)

Both emit the identical message, and both return "cache disabled". So the warning is pure repetition — the path comes from immutable config and won't change within a process.

Proposal

Emit the warning once per process instead of on every operation, and make the message state the consequence (NFS caching disabled until the cache dir is configured). A shared WarnNFSCachePathUnsetOnce(ctx) in packages/shared/pkg/storage (already imported by both call sites, since both call storage.WrapInNFSCache) guarded by sync.Once keeps it to a single line and removes the duplicated string. Behavior (cache disabled) is unchanged.

Happy to send the PR (small, with a unit test).

主要言語
Go
スター
1.8k
フォーク
503
PR マージ指標
30日以内にマージされた PR はありません

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

e2b-dev/runtime のほかの issue

e2b-dev/runtime の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。