Increase heartbeat interval and timeout

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire
2015-12-18 18:53:01 -08:00
parent 80c9f5bbd9
commit 98ca59394a
2 changed files with 3 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ import (
)
var (
heartbeatTimeout = 500 * time.Millisecond
heartbeatTimeout = 10 * time.Second
)
func RegisterDriver(d drivers.Driver) {

View File

@@ -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)