Close the ttyWriter done channel after context cancel by Hashim1999164 · Pull Request #14115 · docker/compose · GitHub
Skip to content

Close the ttyWriter done channel after context cancel - #14115

Closed
Hashim1999164 wants to merge 1 commit into
docker:mainfrom
Hashim1999164:fix/tty-done-after-context-cancel
Closed

Hashim1999164 wants to merge 1 commit into
docker:mainfrom
Hashim1999164:fix/tty-done-after-context-cancel

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 22, 2026 •

Copy link
Copy Markdown

Summary

Fixes #14114

ttyWriter.Done sent on an unbuffered channel. After SIGTERM the render goroutine exits through ctx.Done() and never receives, so Done blocked forever. Closing the channel returns immediately even when that goroutine is already gone.

Test plan

  • go test ./cmd/display/
  • TestDoneAfterContextCancelDoesNotHang covers cancel then Done

Signed-off-by: Hashim1999164 <64767361+Hashim1999164@users.noreply.github.com>
@glours

glours commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@glours glours closed this Aug 24, 2026
@Hashim1999164

Copy link
Copy Markdown
Author

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.

[BUG] ttyWriter.Done still hangs forever when the context was canceled before Done runs

2 participants