Skip to content

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 9, 2026

No description provided.

@dgageot dgageot requested a review from a team as a code owner February 9, 2026 09:25
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

⚠️ Critical Issue Found: Goroutine Leak Risk

This PR fixes the spinner issue by emitting events in error paths, but the new channel sends lack context cancellation protection. The generateTitle function runs as a goroutine and could leak if the context is cancelled while trying to send events.

Impact

  • 3 new unprotected channel sends to a.events
  • If context is cancelled, the event receiver stops reading (see Subscribe function)
  • Once the 128-element buffer fills, the goroutine blocks forever

Fix Required

Wrap all channel sends with context cancellation checks:

select {
case a.events <- runtime.SessionTitle(a.session.ID, ""):
case <-ctx.Done():
    return
}

This pattern is used consistently throughout the codebase (lines 333-338, 363-367, 1077-1081).

Signed-off-by: David Gageot <david.gageot@docker.com>
@dgageot dgageot merged commit 4ba0831 into docker:main Feb 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants