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 {