Conversation
|
Claude finished @canercidam's task in 1m 19s —— View job Review: Remove force kill listener cleanup
SummaryThis PR simplifies the force-kill listener goroutine in One concern raised inline: the goroutine now leaks in the normal (non-force-kill) shutdown path, since No other issues found. The change is straightforward and the |
| go func() { | ||
| <-mainctx.GetForceKillCtx().Done() | ||
| d.stopAllProcessesWithSignal(os.Kill) | ||
| ForceKillSession(d.manifest.ID, keepResources) | ||
| }() |
There was a problem hiding this comment.
This goroutine will never terminate during normal (non-force-kill) shutdown. The forceKillCtx from mainctx is only cancelled on the 3rd interrupt signal. In the common case (graceful exit), the goroutine blocks on this channel indefinitely.
The previous code used a local context.WithCancel + defer cancel() to ensure the goroutine was cleaned up when Stop() returned. Without that, this goroutine leaks for the remainder of the process lifetime.
Since this is a CLI tool that exits shortly after Stop(), this is practically benign — the leaked goroutine gets cleaned up by process exit. But it's worth noting that the old code was more correct in terms of resource management. If Stop() were ever called in a context where the process continues (e.g., tests, session rotation), the leak would accumulate.
No description provided.