fix: stop the access log watcher when Charon shuts down
Maintainer thường phản hồi trong vòng 1 ngày
@Wikid82 đang làm issue này rồi.
Từ ngày 3/12/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Read backend/internal/services/log_watcher.go and the watcher setup in backend/internal/api/routes/routes.go; compare how the stats ingester and hub receive the application context. Start by tracing LogWatcher.Start(ctx) and its tail loop. Add a test that cancellation stops the loop, then verify the watcher shuts down with server.Run(ctx) and releases its resources.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What
The access log watcher keeps running until the process exits instead of stopping with the application context.
backend/internal/api/routes/routes.go(log watcher block,logWatcher.Start(context.Background())) starts it with a background context, and nothing callsLogWatcher.Stop()at shutdown.LogWatcher.Start(ctx)(backend/internal/services/log_watcher.go:45) ignores itsctxargument; the tail loop watches the watcher's own context created inNewLogWatcher(:34-42).
CLAUDE.md asks long-running work to respect server.Run(ctx).
Severity
Low. The process exits at shutdown anyway; the gap is an unclean stop (open file handle, subscriber channels left open) and a pattern that differs from the stats ingester and hub, which take ctx.
Suggested approach
Have Start derive the tail loop's context from its ctx argument (or call Stop from context.AfterFunc(ctx, ...)), pass the application context from RegisterWithDeps, and add a test that the tail loop ends when the context is cancelled.
Found while planning #2132.
- Ngôn ngữ chính
- Go
- Star
- 17
- Fork
- 2
- Merge trung bình
- 1 giờ 42 phút
- Pull request đã merge (30 ngày)
- 173
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 Wikid82/Charon
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs promise signed SLSA provenance that the image build does not produceCó thể đã có người làm @Wikid82 đã nhận hôm nay. Đang mởarchitecture documentation security ui
Wikid82/Charon#2152 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Orthrus agent images are not signed or SBOM-attestedCó thể đã có người làm @Wikid82 đã nhận hôm nay. Đang mởsecurity ssl testing
Wikid82/Charon#2151 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Registry prune deletes release image signatures and SBOM attestations on GHCR after 7 daysCó thể đã có người làm @Wikid82 đã nhận hôm nay. Đang mởcritical testing
Wikid82/Charon#2150 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Minor follow-ups from the country-allow-list local-network reviewCó thể đã có người làm @Wikid82 đã nhận hôm nay. Đang mởarchitecture backend documentation frontend low
Wikid82/Charon#2149 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Wikid82/Charon
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
turbot/flowpipe#1162 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LifetimeRemaining divides by zero when expireAfter is 0s, producing NaN disruption costsCó thể đã có người làm @weirong-ui đã nhận hôm nay. Đang mởkind/bug needs-priority needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
kubernetes-sigs/karpenter#3728 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compaction: redundant exclusion checks after inRangeCó thể đã có người làm @moodbased đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
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 78/100
docker/mcp-registry#8199 ·
Maintainer thường phản hồi trong vòng 2 ngày