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

Commit

Permalink
Merge pull request #1360 from IRCody/lengthen_timeouts
Browse files Browse the repository at this point in the history
Makes plugin healthchecks less aggressive
  • Loading branch information
kindermoumoute authored Nov 21, 2016
2 parents 8f4c1bc + a3510e3 commit 1230806
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 @@ -45,7 +45,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 1230806

Please sign in to comment.