Skip to content

Commit f298084

Browse files
authored
[FC] Fix context cancellation bug when reporting snapshot metadata (#11345)
The context is being canceled [here](https://github.com/buildbuddy-io/buildbuddy/blob/master/enterprise/server/remote_execution/containers/firecracker/firecracker.go#L2501). Defers run LIFO There is a test for this bug (and an additional one) in this [PR](https://github.com/buildbuddy-io/buildbuddy/pull/11302/changes#diff-095afcdc05618fde198c278a09b3c5f964cd16cd8eb0f6efbe9639f90b0697ff)
1 parent 2c8e85b commit f298084

File tree

1 file changed

+3
-0
lines changed
  • enterprise/server/remote_execution/containers/firecracker

1 file changed

+3
-0
lines changed

enterprise/server/remote_execution/containers/firecracker/firecracker.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,6 +2400,9 @@ func (c *FirecrackerContainer) Exec(ctx context.Context, cmd *repb.Command, stdi
24002400
stage := "init"
24012401
result := &interfaces.CommandResult{ExitCode: commandutil.NoExitCode}
24022402
defer func() {
2403+
ctx, cancel = background.ExtendContextForFinalization(ctx, finalizationTimeout)
2404+
defer cancel()
2405+
24032406
// Attach VM metadata to the result
24042407
result.VMMetadata = c.getVMMetadata()
24052408
// Include whether the snapshot will be saved, so it can be displayed in the UI.

0 commit comments

Comments
 (0)