Show when sccache statistics come from the no-server fallback
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
Línea de trabajo
Empieza en Command::ShowStats en src/commands.rs y sigue la ruta alternativa sin servidor hasta el formateador de texto en src/server.rs. Comprueba cómo se conservan la ruta alternativa JSON existente y el código de salida; después, añade una prueba específica que distinga un servidor activo con cero solicitudes de la ruta alternativa sin servidor. La tarea estará completa cuando la salida de texto indique que los contadores no están disponibles después de que el servidor deje de responder, mientras el comportamiento JSON permanece intacto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 8k
- Forks
- 835
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 60
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mozilla/sccache
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
sccache-dist: Docker builder hangs indefinitely — `docker cp -` is never sent EOFPosiblemente ocupada @oguzhanmeteozturk la tomó hace 114 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mozilla/sccache#437 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
mozilla/sccache#3082 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de mozilla/sccache
Issues similares
-
documentation good first issue help wanted
Dificultad 2/5 Medio día Aptitud para principiantes 78/100
fidan-lang/fidan#18 ·
-
area:contracts kind:docs prio:low
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
[Feature]: Add locale for FrenchAbiertoenhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
opentaikai/stemma-flow#142 ·
Los mantenedores suelen responder en 1 día
-
area:kernel needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
bherbruck/solvecraft#26460 ·