filecachegc.runPass suppresses eviction logs when FreedBytes < target and consecutiveShortfalls > 3
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Đọc cmd/atelet/internal/filecachegc/filecachegc.go, đặc biệt là nhánh shortfall ở các dòng 298–313 và các phép tính pass ở các dòng 274–293. Theo dõi cách số lượng eviction được chuyển đến phần ghi log shortfall và metric recordPass, sau đó kiểm tra các bài test file cache GC hiện có. Công việc hoàn tất khi một pass evict các mục phát ra log eviction ngay cả khi các nhắc nhở shortfall bị giới hạn, và hành vi này được bao phủ bằng một bài test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 = 12cmd/atelet/internal/filecachegc/filecachegc.go:274-293: the pass computesstatsandevictedcmd/atelet/internal/filecachegc/filecachegc.go:298-313: the shortfall branch logs only whenconsecutiveShortfalls <= 3orconsecutiveShortfalls%12 == 0, whether or notevicted > 0. Then it returnscmd/atelet/internal/filecachegc/filecachegc.go:311: the eviction is still counted in therecordPassmetric
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
- 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. - Wait for more than 3 consecutive shortfall passes while two runtimes are linked (
skipped_linked: 2). - 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_bytessimply 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}
- Ngôn ngữ chính
- Go
- Star
- 5.9k
- Fork
- 637
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 562
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của agent-substrate/substrate
-
Clean up the ko retry testsĐang mởarea/dev-infra area/reliability area/tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
agent-substrate/substrate#3461 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/network kind/cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
agent-substrate/substrate#3428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kubectl-ate create actor-template -f <file> fails with useless errorCó thể đã có người làm @cloudonly đã nhận hôm nay. Đang mởarea/cli kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
agent-substrate/substrate#3406 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
k8s-credential-provider manifest is missing ate-otel-config envFrom, failing OTLP metric exports to [::1]:4317 / 127.0.0.1:4317 every 60sCó thể đã có người làm @ericcurtin đã nhận 1 ngày trước. Đang mởarea/dev-infra area/observability area/security kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
agent-substrate/substrate#3282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs/egress-trust-bundle.md documents ActorTemplate as a Kubernetes CRD rejected by kubectl ate create actor-template and uses mismatched trust-bundle mount pathsCó thể đã có người làm @moficodes đã nhận 1 ngày trước. Đang mởarea/network area/security kind/docs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
agent-substrate/substrate#3278 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của agent-substrate/substrate
Issue tương tự
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
projectdiscovery/notify#569 ·
-
internal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Results from sources can contain invalid host namesCó thể đã có người làm @Mzack9999 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
projectdiscovery/subfinder#1983 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
radius-project/radius#13566 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày