Show when sccache statistics come from the no-server fallback
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/commands.rs の Command::ShowStats から始め、サーバーなしのフォールバックを src/server.rs のテキストフォーマッターまで追ってください。既存の JSON フォールバックと終了ステータスがどのように維持されるかを確認し、稼働中のサーバーでリクエスト数がゼロの場合とサーバーなしのフォールバックを区別する、焦点を絞ったテストを追加してください。サーバーが応答しなくなった後、テキスト出力でカウンターが利用できないことが示され、JSON の動作が維持されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Observed in CI
A successful Windows job used sccache v0.20.1 to compile its Rust targets, then ran integration tests for about 14 minutes without another compiler invocation. The last logged sccache invocation was at 07:27:42 UTC (raw line 2568). Its end-of-job JSON-based summary reported zero compiler requests at 07:41:38 (raw lines 233288–233291). That job did not print the JSON effective mode, so we cannot directly identify why its daemon stopped responding. The timing matches the default 600-second idle timeout. In a separate shorter job using the same workflow and sccache version, the summary recorded 1,330 requests.
Windows job and raw log, comparison Windows job.
Bounded reproduction
In a disposable Linux shell with v0.20.1, GCC and jq available, the following isolates the daemon and reduces the idle timeout to five seconds. This small standalone sequence is derived from the source. Our observed result is the Windows job above.
set -eu
work=$(mktemp -d)
export SCCACHE_DIR="$work/cache"
export SCCACHE_SERVER_UDS="$work/sccache.sock"
export SCCACHE_IDLE_TIMEOUT=5
export SCCACHE_CACHE_SIZE=32M
trap 'sccache --stop-server >/dev/null 2>&1 || true; rm -rf -- "$work"' EXIT
printf 'int sample(void) { return 42; }\n' > "$work/sample.c"
sccache gcc -c "$work/sample.c" -o "$work/sample.o"
sccache --show-stats --stats-format=json |
jq '{compile_requests: .stats.compile_requests, effective_cache_mode}'
sleep 7
sccache --show-stats
sccache --show-stats --stats-format=json |
jq '{compile_requests: .stats.compile_requests, effective_cache_mode}'
The first query should report a live mode and a positive request count. After idle shutdown, the text and JSON queries print zero counters and exit successfully. The JSON mode is null. A reader of the text sees counters that look like an idle but still-running daemon's report. The human-readable output prints the effective mode only in advanced mode and when the mode is present.
The code path is the 600-second default, the idle shutdown branch, the empty fallback in ShowStats and the text formatting branch. This is separate from the JSON mode support added for issue #2842.
Workaround and suggested change
Read effective_cache_mode from JSON and report unavailable counters when it is null. For an ephemeral CI job, set SCCACHE_IDLE_TIMEOUT at least as long as the compile-to-report interval or read the counters before a long test-only phase.
In Command::ShowStats, preserve the fallback JSON and exit status, and pass the absence of a connection to the text formatter as an explicit status. For example, print a diagnostic that the server did not respond and that the counters cannot represent previous compiler activity. Test the live server with zero requests separately from the no-server fallback. An opt-in flag that fails on a missing server could also help automation that needs a reliable cache measurement.
- 主要言語
- Rust
- スター
- 8k
- フォーク
- 835
- 平均マージ
- 3日 6時間
- マージ済み PR(30日)
- 60
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mozilla/sccache のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
sccache-dist: Docker builder hangs indefinitely — `docker cp -` is never sent EOF対応中かも @oguzhanmeteozturk が 114 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mozilla/sccache#437 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
mozilla/sccache#3082 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
mozilla/sccache の issue をすべて見る
似ている issue
-
documentation good first issue help wanted
難易度 2/5 半日 初心者へのやさしさ 78/100
fidan-lang/fidan#18 ·
-
area:contracts kind:docs prio:low
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
opentaikai/stemma-flow#142 ·
メンテナーはふだん 1 日以内に返信
-
area:kernel needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
bherbruck/solvecraft#26460 ·