From 5731be4b794aaa13d92534a6028f277625fbc4cf Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 30 Apr 2020 17:12:05 -0400 Subject: [PATCH] csi: restore long timeout for controller plugins (#7840) During MVP development, we reduced the timeout for controller plugins to avoid long hangs in GC workers. But now that this work has been moved to the volume watcher, we can restore the original timeout which is better suited for the characteristic timescales of some cloud provider APIs and better matches the behavior of k8s. --- client/csi_endpoint.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/csi_endpoint.go b/client/csi_endpoint.go index 668bca303..a4251e473 100644 --- a/client/csi_endpoint.go +++ b/client/csi_endpoint.go @@ -143,12 +143,12 @@ func (c *CSI) ControllerDetachVolume(req *structs.ClientCSIControllerDetachVolum csiReq := req.ToCSIRequest() // Submit the request for a volume to the CSI Plugin. - ctx, cancelFn := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancelFn := c.requestContext() defer cancelFn() // CSI ControllerUnpublishVolume errors for timeout, codes.Unavailable and // codes.ResourceExhausted are retried; all other errors are fatal. _, err = plugin.ControllerUnpublishVolume(ctx, csiReq, - grpc_retry.WithPerRetryTimeout(10*time.Second), + grpc_retry.WithPerRetryTimeout(CSIPluginRequestTimeout), grpc_retry.WithMax(3), grpc_retry.WithBackoff(grpc_retry.BackoffExponential(100*time.Millisecond))) if err != nil {