fix: stop the access log watcher when Charon shuts down
Mantenedores costumam responder em até 1 dia
@Wikid82 já está trabalhando nisso.
Desde 3/12/2026.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 76/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 17
- Forks
- 2
- Merge médio
- 1h 42min
- PRs com merge (30d)
- 173
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Wikid82/Charon
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Docs promise signed SLSA provenance that the image build does not produceTalvez já em andamento @Wikid82 assumiu hoje. Abertaarchitecture documentation security ui
Wikid82/Charon#2152 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Orthrus agent images are not signed or SBOM-attestedTalvez já em andamento @Wikid82 assumiu hoje. Abertasecurity ssl testing
Wikid82/Charon#2151 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Registry prune deletes release image signatures and SBOM attestations on GHCR after 7 daysTalvez já em andamento @Wikid82 assumiu hoje. Abertacritical testing
Wikid82/Charon#2150 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Minor follow-ups from the country-allow-list local-network reviewTalvez já em andamento @Wikid82 assumiu hoje. Abertaarchitecture backend documentation frontend low
Wikid82/Charon#2149 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de Wikid82/Charon
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
agent:ready
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
turbot/flowpipe#1162 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
LifetimeRemaining divides by zero when expireAfter is 0s, producing NaN disruption costsTalvez já em andamento @weirong-ui assumiu hoje. Abertakind/bug needs-priority needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
kubernetes-sigs/karpenter#3728 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
compaction: redundant exclusion checks after inRangeTalvez já em andamento @moodbased assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia