From d60cb3c70b3b9b47dfcdf31a7879e08a8258b225 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 9 Oct 2020 10:39:06 -0400 Subject: [PATCH] csi: fix incorrect comment on csi_hook context lifetime --- client/allocrunner/csi_hook.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/client/allocrunner/csi_hook.go b/client/allocrunner/csi_hook.go index 1b03d301f19..3f667363539 100644 --- a/client/allocrunner/csi_hook.go +++ b/client/allocrunner/csi_hook.go @@ -34,12 +34,10 @@ func (c *csiHook) Prerun() error { return nil } - // TODO(tgross): the contexts for the CSI RPC calls made during - // mounting can have very long timeouts. Until these are better - // tuned, there's not a good value to put here for a WithCancel - // without risking conflicts with the grpc retries/timeouts in the - // pluginmanager package. - ctx := context.TODO() + // We use this context only to attach hclog to the gRPC context. The + // lifetime is the lifetime of the gRPC stream, not specific RPC timeouts, + // but we manage the stream lifetime via Close in the pluginmanager. + ctx := context.Background() volumes, err := c.claimVolumesFromAlloc() if err != nil {