Show when sccache statistics come from the no-server fallback
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 77/100
Direzione di ricerca
Inizia da Command::ShowStats in src/commands.rs e segui il fallback senza server fino al formattatore di testo in src/server.rs. Verifica come vengono preservati il fallback JSON esistente e il codice di uscita, quindi aggiungi un test mirato che distingua un server attivo con zero richieste dal fallback senza server. Il lavoro è completato quando l’output testuale indica che i contatori non sono disponibili dopo che il server smette di rispondere, mentre il comportamento JSON rimane intatto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 8k
- Fork
- 835
- Merge medio
- 3g 6h
- PR unite (30g)
- 60
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mozilla/sccache
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
sccache-dist: Docker builder hangs indefinitely — `docker cp -` is never sent EOFForse già presa @oguzhanmeteozturk l’ha presa 114 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
mozilla/sccache#437 · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
mozilla/sccache#3082 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di mozilla/sccache
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Commit lockfileAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rust-lang/socket2#703 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
infra
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
available bug good first issue tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Nixitov/Riptide-Native#817 ·
I maintainer di solito rispondono entro 1 giorno