Skip to content

Daily fixes for the Nightly issue detector#1787

Merged
dgageot merged 2 commits intodocker:mainfrom
dgageot:daily-fixes-2
Feb 19, 2026
Merged

Daily fixes for the Nightly issue detector#1787
dgageot merged 2 commits intodocker:mainfrom
dgageot:daily-fixes-2

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 19, 2026

No description provided.

When pprof.StartCPUProfile fails, the file was left to be closed by
a deferred call placed before the error check. This could shadow the
original error and delay resource cleanup. Now the file is closed
explicitly on error, and defer is placed after the success path.

Fixes docker#1770
Fixes docker#1765

Assisted-By: cagent
The f.Close() call was ignoring the returned error. Now we log a
warning if closing the first-run marker file fails.

Fixes docker#1769

Assisted-By: cagent
@dgageot dgageot requested a review from a team as a code owner February 19, 2026 09:03
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

Approved - No issues found in the changed code.

This PR improves resource handling by:

  1. cmd/root/root.go: Properly checking the error from f.Close() and logging it
  2. cmd/root/run.go: Fixing the defer order for CPU profiling cleanup to ensure pf.Close() happens after pprof.StopCPUProfile(), and properly closing the file on error before returning

The changes follow Go best practices for resource management and error handling. Nice cleanup work!

@dgageot dgageot merged commit 04cbf3a into docker:main Feb 19, 2026
8 checks passed
@dgageot dgageot deleted the daily-fixes-2 branch February 27, 2026 19:37
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