diff --git a/util/flightcontrol/flightcontrol.go b/util/flightcontrol/flightcontrol.go index 120be2f12555..f06d4e895499 100644 --- a/util/flightcontrol/flightcontrol.go +++ b/util/flightcontrol/flightcontrol.go @@ -116,7 +116,9 @@ func newCall(fn func(ctx context.Context) (interface{}, error)) *call { func (c *call) run() { defer c.closeProgressWriter() - v, err := c.fn(c.ctx) + ctx, cancel := context.WithCancel(c.ctx) + defer cancel() + v, err := c.fn(ctx) c.mu.Lock() c.result = v c.err = err