Skip to content

Commit

Permalink
Check error in OpenSQLConnection (kubeflow#588)
Browse files Browse the repository at this point in the history
* Check error in openSQLconn

* Add logic in v1alpha1

* Change to Errorf
  • Loading branch information
andreyvelich authored and k8s-ci-robot committed May 28, 2019
1 parent c2b6f9e commit 4f678e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/db/v1alpha1/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func openSQLConn(driverName string, dataSourceName string, interval time.Duratio
if err = db.Ping(); err == nil {
return db, nil
}
klog.Errorf("Ping to Katib db failed: %v", err)
} else {
klog.Errorf("Open sql connection failed: %v", err)
}
case <-timeoutC:
return nil, fmt.Errorf("Timeout waiting for DB conn successfully opened.")
Expand Down
3 changes: 3 additions & 0 deletions pkg/db/v1alpha2/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func openSQLConn(driverName string, dataSourceName string, interval time.Duratio
if err = db.Ping(); err == nil {
return db, nil
}
klog.Errorf("Ping to Katib db failed: %v", err)
} else {
klog.Errorf("Open sql connection failed: %v", err)
}
case <-timeoutC:
return nil, fmt.Errorf("Timeout waiting for DB conn successfully opened.")
Expand Down

0 comments on commit 4f678e2

Please sign in to comment.