Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Makes plugin healthchecks less aggressive
Browse files Browse the repository at this point in the history
Lengthens the timeout for plugin health checks in order to be less
aggressive about killing plugins.
  • Loading branch information
croseborough committed Nov 17, 2016
1 parent 46c56b2 commit a3510e3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion control/available_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (
// DefaultClientTimeout - default timeout for a client connection attempt
DefaultClientTimeout = time.Second * 10
// DefaultHealthCheckTimeout - default timeout for a health check
DefaultHealthCheckTimeout = time.Second * 1
DefaultHealthCheckTimeout = time.Second * 10
// DefaultHealthCheckFailureLimit - how any consecutive health check timeouts must occur to trigger a failure
DefaultHealthCheckFailureLimit = 3
)
Expand Down
2 changes: 1 addition & 1 deletion control/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
MonitorStarted

// DefaultMonitorDuration - the default monitor duration.
DefaultMonitorDuration = time.Second * 1
DefaultMonitorDuration = time.Second * 5
)

type monitorState int
Expand Down
2 changes: 1 addition & 1 deletion control/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestMonitor(t *testing.T) {
oldOpt := m.Option(MonitorDurationOption(time.Millisecond * 200))
So(m.duration, ShouldResemble, time.Millisecond*200)
m.Option(oldOpt)
So(m.duration, ShouldResemble, time.Second*1)
So(m.duration, ShouldResemble, time.Second*5)
})
})
}
2 changes: 1 addition & 1 deletion control/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const (
var (
// Timeout settings
// How much time must elapse before a lack of Ping results in a timeout
PingTimeoutDurationDefault = time.Millisecond * 1500
PingTimeoutDurationDefault = time.Second * 10

// Array matching plugin type enum to a string
// note: in string representation we use lower case
Expand Down
1 change: 1 addition & 0 deletions control/plugin/session_deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func (s *SessionState) generateResponse(r *Response) []byte {
func (s *SessionState) heartbeatWatch(killChan chan int) {
s.logger.Debug("Heartbeat started")
count := 0
s.ResetHeartbeat()
for {
if time.Since(s.LastPing) >= s.PingTimeoutDuration {
count++
Expand Down

0 comments on commit a3510e3

Please sign in to comment.