Increase heartbeat interval and timeout
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
heartbeatTimeout = 500 * time.Millisecond
|
||||
heartbeatTimeout = 10 * time.Second
|
||||
)
|
||||
|
||||
func RegisterDriver(d drivers.Driver) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
heartbeatInterval = 200 * time.Millisecond
|
||||
heartbeatInterval = 5 * time.Second
|
||||
)
|
||||
|
||||
type RPCClientDriver struct {
|
||||
@@ -138,13 +138,12 @@ func NewRPCClientDriver(driverName string, rawDriver []byte) (*RPCClientDriver,
|
||||
select {
|
||||
case <-c.heartbeatDoneCh:
|
||||
return
|
||||
default:
|
||||
case <-time.After(heartbeatInterval):
|
||||
if err := c.Client.Call(HeartbeatMethod, struct{}{}, nil); err != nil {
|
||||
log.Warnf("Error attempting heartbeat call to plugin server: %s", err)
|
||||
c.Close()
|
||||
return
|
||||
}
|
||||
time.Sleep(heartbeatInterval)
|
||||
}
|
||||
}
|
||||
}(c)
|
||||
|
||||
Reference in New Issue
Block a user