Skip to content

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 11, 2026

No description provided.

Change setupRecordingProxy to return func() error instead of swallowing
errors internally, making it consistent with setupFakeProxy. Use a named
return in runOrExec so deferred cleanup errors are propagated when no
prior error occurred.

Fixes docker#1691

Assisted-By: cagent
Add a done channel to ensure the background goroutine that closes stdin exits cleanly when monitorStdin returns, not only when the context is cancelled. This prevents the goroutine from leaking if stdin closes before context cancellation.

Fixes docker#1664

Assisted-By: cagent
@dgageot dgageot requested a review from a team as a code owner February 11, 2026 15:29
Copy link

@docker-agent docker-agent 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

No bugs found in the changed code! ✅

This PR properly addresses error handling improvements:

  • Changes cleanup function signatures from func() to func() error to allow proper error propagation
  • Adds error handling for deferred cleanup functions
  • Properly logs errors when file close operations fail
  • Updates tests to verify error returns
  • Implements goroutine cleanup pattern to prevent leaks in monitorStdin

All changes are technically sound and follow Go best practices.

@dgageot dgageot merged commit 05d9aa1 into docker:main Feb 11, 2026
8 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