Skip to content

Commit

Permalink
agent/acs/acs_handler.go: Reduce the heartbeat timeout to 1 minute
Browse files Browse the repository at this point in the history
    This will reduce the acs disconnection period, the maximum
    disconnection period of acs would be 2 minutes before agent
    try to connect to acs again.
  • Loading branch information
richardpen committed Aug 7, 2017
1 parent bd577e5 commit af6e51e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/acs/handler/acs_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import (
const (
// heartbeatTimeout is the maximum time to wait between heartbeats
// without disconnecting
heartbeatTimeout = 5 * time.Minute
heartbeatJitter = 3 * time.Minute
heartbeatTimeout = 1 * time.Minute
heartbeatJitter = 1 * time.Minute

inactiveInstanceReconnectDelay = 1 * time.Hour

Expand Down Expand Up @@ -298,7 +298,7 @@ func (acsSession *session) startACSSession(client wsclient.ClientServer, timer t
backoffResetTimer := time.AfterFunc(
utils.AddJitter(acsSession.heartbeatTimeout(), acsSession.heartbeatJitter()), func() {
// If we do not have an error connecting and remain connected for at
// least 5 or so minutes, reset the backoff. This prevents disconnect
// least 1 or so minutes, reset the backoff. This prevents disconnect
// errors that only happen infrequently from damaging the
// reconnectability as significantly.
acsSession.backoff.Reset()
Expand Down

0 comments on commit af6e51e

Please sign in to comment.