Skip to content

Commit 81b2f47

Browse files
committed
move withoutCancel to the goroutine (instead of arg)
1 parent 610e3d8 commit 81b2f47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/orchestrator/internal/server/sandboxes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ func (s *server) Create(ctx context.Context, req *orchestrator.SandboxCreateRequ
129129
}
130130

131131
s.sandboxes.Insert(req.Sandbox.SandboxId, sbx)
132-
go func(ctx context.Context) {
133-
ctx, childSpan := s.tracer.Start(ctx, "sandbox-create-stop", trace.WithNewRoot())
132+
go func() {
133+
ctx, childSpan := s.tracer.Start(context.WithoutCancel(ctx), "sandbox-create-stop", trace.WithNewRoot())
134134
defer childSpan.End()
135135

136136
waitErr := sbx.Wait(ctx)
@@ -162,7 +162,7 @@ func (s *server) Create(ctx context.Context, req *orchestrator.SandboxCreateRequ
162162
s.proxy.RemoveFromPool(sbx.Runtime.ExecutionID)
163163

164164
sbxlogger.E(sbx).Info("Sandbox killed")
165-
}(context.WithoutCancel(ctx))
165+
}()
166166

167167
label := clickhouse.SandboxEventLabelCreate
168168
if req.Sandbox.Snapshot {

0 commit comments

Comments
 (0)