Skip to content

Commit

Permalink
engine: fix context error wrapping in executor (#7608)
Browse files Browse the repository at this point in the history
When an exec fails due to context canceled, we were dropping the
cancelation error and just returning the exec error. I believe this got
fat-fingered while updating the code from upstream to use fmt.Errorf
instead of github.com/pkg/errors.

It's not clear if this is really meaningful, but noticed it changed
while attempting to debug occurances of "exit code 137" in our CI, which
plausibly could be related to all of this. It's possible there's calling
code that tries to handle cancelation with errors.Is, which this
would have broken. This is purely hypothetical at this point though.

Signed-off-by: Erik Sipsma <[email protected]>
  • Loading branch information
sipsma authored Jun 11, 2024
1 parent dee8a9f commit 573e65d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine/buildkit/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func exitError(ctx context.Context, exitCodePath string, err error) error {

select {
case <-ctx.Done():
exitErr.Err = fmt.Errorf(exitErr.Error())
exitErr.Err = fmt.Errorf("%s: %w", exitErr.Error(), context.Cause(ctx))
return exitErr
default:
return stack.Enable(exitErr)
Expand Down

0 comments on commit 573e65d

Please sign in to comment.