Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

filecachegc.runPass suppresses eviction logs when FreedBytes < target and consecutiveShortfalls > 3

Abierto Apto para principiantes
#3,281 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend

Línea de trabajo

Lee cmd/atelet/internal/filecachegc/filecachegc.go, especialmente la rama de shortfall en las líneas 298–313 y los cálculos del pass en las líneas 274–293. Sigue cómo los recuentos de eviction llegan al registro de shortfall y a la métrica recordPass, y luego revisa las pruebas existentes de file cache GC. El trabajo estará hecho cuando un pass que elimine entradas emita un registro de eviction incluso cuando se limiten las notificaciones de shortfall, y una prueba cubra este comportamiento.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area/node area/observability area/storage kind/bug
Summary & Root Cause

The shortfall check (FreedBytes < target) comes before any eviction-specific logging, and the throttle covers the whole branch. When --sandbox-asset-cache-max-bytes is smaller than the pinned entries, every pass is a shortfall. After the third pass, a pass that does evict an entry (here a 164.9 MiB gVisor runtime) logs nothing unless its counter happens to be a multiple of 12. The eviction is visible only in the recordPass metric.

Affected Code Locations
  • cmd/atelet/internal/filecachegc/filecachegc.go:43-48: shortfallWarnLimit = 3, shortfallReminderEvery = 12
  • cmd/atelet/internal/filecachegc/filecachegc.go:274-293: the pass computes stats and evicted
  • cmd/atelet/internal/filecachegc/filecachegc.go:298-313: the shortfall branch logs only when consecutiveShortfalls <= 3 or consecutiveShortfalls%12 == 0, whether or not evicted > 0. Then it returns
  • cmd/atelet/internal/filecachegc/filecachegc.go:311: the eviction is still counted in the recordPass metric
	if stats.FreedBytes < target {
		g.consecutiveShortfalls++
		switch {
		case g.consecutiveShortfalls <= shortfallWarnLimit:
			slog.WarnContext(ctx, "File cache GC could not reach its budget", ...)
		case g.consecutiveShortfalls%shortfallReminderEvery == 0:
			slog.WarnContext(ctx, "File cache GC still over its budget; ...", ...)
		}
		g.instruments.recordPass(ctx, g.name, ateattr.FileCacheGCOutcomeShortfall, evicted)
		return
	}
Detailed Reproduction Guide
  1. Run atelet with a cache budget smaller than one runtime (see the patch in S-12): --sandbox-asset-cache-max-bytes=1048576, --sandbox-asset-cache-gc-period=5s, --sandbox-asset-cache-min-age=0s.
  2. Wait for more than 3 consecutive shortfall passes while two runtimes are linked (skipped_linked: 2).
  3. Unlink one runtime, for example by switching the default (kubectl patch sandboxconfig gvisor-default --type=merge -p '{"spec":{"defaultVersion":"v5"}}'), and follow the GC log:
kubectl logs -n ate-system <atelet-pod> -c atelet -f | grep -E 'File cache GC|Wrote worker sandbox runtimes'
Expected vs. Actual Behavior
  • Expected: Any pass that actually evicts entries (evicted > 0) logs the eviction, whatever the shortfall throttle says.
  • Actual: The evicting pass emits no log line. cache_bytes simply drops between two throttled reminders.
Observed Output & Logs
{"time":"2026-10-27T00:53:53.659828907Z","level":"WARN","msg":"File cache GC still over its budget; what remains is linked by a consumer, younger than the min age, or busy","cache":"sandbox_asset","cache_bytes":329842688,"max_bytes":1048576,"target_bytes":328898970,"freed_bytes":0,"evicted":0,"skipped_linked":2,"skipped_young":0,"skipped_busy":0,"dry_run":false,"took":169717,"consecutive":12}
{"time":"2026-10-27T00:53:59.09342848Z","level":"INFO","msg":"Wrote worker sandbox runtimes","pod_uid":"b30f8613-ad63-401f-9753-68c97bbe9dbd","sandbox_config":"gvisor-default","sandbox_class":"gvisor","default_bundle_hash":"sha256:078445e3672a4bad894f713a43f519e50bff3b9b09a257b8b30a1ecc6ebb5b58","restorable_runtimes":1}
{"time":"2026-10-27T00:54:53.659679459Z","level":"WARN","msg":"File cache GC still over its budget; what remains is linked by a consumer, younger than the min age, or busy","cache":"sandbox_asset","cache_bytes":164921344,"max_bytes":1048576,"target_bytes":163977626,"freed_bytes":0,"evicted":0,"skipped_linked":1,"skipped_young":0,"skipped_busy":0,"dry_run":false,"took":114997,"consecutive":24}
{"time":"2026-10-27T02:24:22.658293993Z","msg":"File cache GC still over its budget; …","cache_bytes":164921344,"freed_bytes":0,"evicted":0,"skipped_linked":1,"consecutive":12}
{"time":"2026-10-27T02:25:22.658130264Z","msg":"File cache GC still over its budget; …","cache_bytes":164921344,"freed_bytes":0,"evicted":0,"skipped_linked":1,"consecutive":24}
Lenguaje dominante
Go
Estrellas
5.9k
Forks
637
Merge medio
2 d 10 h
PR fusionados (30 d)
556

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de agent-substrate/substrate

Todos los issues de agent-substrate/substrate

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.