Skip to content

Commit

Permalink
csi: restore long timeout for controller plugins (#7840)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tgross authored Apr 30, 2020
1 parent 610e0a6 commit 5731be4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/csi_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5731be4

Please sign in to comment.