diff --git a/.changelog/15180.txt b/.changelog/15180.txt new file mode 100644 index 000000000..342a238c7 --- /dev/null +++ b/.changelog/15180.txt @@ -0,0 +1,3 @@ +```release-note:bug +drivers: Fixed a bug where one goroutine was leaked per task +``` diff --git a/plugins/drivers/client.go b/plugins/drivers/client.go index 592d47b74..68389a960 100644 --- a/plugins/drivers/client.go +++ b/plugins/drivers/client.go @@ -187,7 +187,8 @@ func (d *driverPluginClient) handleWaitTask(ctx context.Context, id string, ch c } // Join the passed context and the shutdown context - joinedCtx, _ := joincontext.Join(ctx, d.doneCtx) + joinedCtx, joinedCtxCancel := joincontext.Join(ctx, d.doneCtx) + defer joinedCtxCancel() resp, err := d.client.WaitTask(joinedCtx, req) if err != nil {