Skip to content

Commit

Permalink
Fix #89: Increase probe timeout
Browse files Browse the repository at this point in the history
The Probe timeout is set to 1 second, which is insufficient for most
plugins that want to do a thorough health check.

Change the timeout to the default of 1 minute, like we did in the
external-attacher.
  • Loading branch information
Akrog committed Feb 26, 2019
1 parent f59b58d commit 0cc84ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ func main() {
os.Exit(1)
}

// Check it's ready
if err = waitForDriverReady(csiConn, *connectionTimeout); err != nil {
glog.Error(err.Error())
os.Exit(1)
}

// Pass a context with a timeout
ctx, cancel := context.WithTimeout(context.Background(), csiTimeout)
defer cancel()
Expand All @@ -140,12 +146,6 @@ func main() {
}
glog.V(2).Infof("CSI driver name: %q", *snapshotter)

// Check it's ready
if err = waitForDriverReady(csiConn, *connectionTimeout); err != nil {
glog.Error(err.Error())
os.Exit(1)
}

// Find out if the driver supports create/delete snapshot.
supportsCreateSnapshot, err := csiConn.SupportsControllerCreateSnapshot(ctx)
if err != nil {
Expand Down Expand Up @@ -206,7 +206,7 @@ func waitForDriverReady(csiConn connection.CSIConnection, timeout time.Duration)
finish := now.Add(timeout)
var err error
for {
ctx, cancel := context.WithTimeout(context.Background(), csiTimeout)
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
err = csiConn.Probe(ctx)
if err == nil {
Expand Down

0 comments on commit 0cc84ea

Please sign in to comment.