Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve stacks of cancels from defers #5536

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

tonistiigi
Copy link
Member

In this case the current stack trace points to the line where the context was created. Instead the stack should be captured when the defer is running so the return path to the defer call is also part of the stack.

In this case the current stack trace points to the line
where the context was created. Instead the stack should be
captured when the defer is running so the return path to
the defer call is also part of the stack.

Signed-off-by: Tonis Tiigi <[email protected]>
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

Ah good catch I was looking at your lint changes in buildx and was wondering if buildkit needed changes as well.

PS: With golangci-lint 1.62 it would trigger a lostcancel: the cancel function returned by context.WithTimeoutCause should be called, not discarded, to avoid a context leak (govet) but that's a false positive as we are handling cancel in parent already. See docker/buildx#2782 (comment)

@tonistiigi tonistiigi merged commit d0e9336 into moby:master Nov 20, 2024
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants