From fca5a9870035fa7cfbb08d707c6e50c105050da4 Mon Sep 17 00:00:00 2001 From: stswidwinski Date: Tue, 8 Nov 2022 05:59:13 +0800 Subject: [PATCH 1/2] Fix goroutine leakage --- plugins/drivers/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/drivers/client.go b/plugins/drivers/client.go index 592d47b743f7..68389a9604fc 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 { From ab1eaf1b1b46ef66b6279494a846f474e8d1f4bd Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 8 Nov 2022 07:39:52 -0600 Subject: [PATCH 2/2] cl: add cl entry --- .changelog/15180.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/15180.txt diff --git a/.changelog/15180.txt b/.changelog/15180.txt new file mode 100644 index 000000000000..342a238c7175 --- /dev/null +++ b/.changelog/15180.txt @@ -0,0 +1,3 @@ +```release-note:bug +drivers: Fixed a bug where one goroutine was leaked per task +```