reset watch's lastIndex on error
When a -dev agent is restarted it'll have a clean state, including a reset index. A watch() will reconnect after a restart, but it won't notice that the index counter has reset and it will keep waiting until we reached the old index again, which is wrong. Resetting the index will prevent that and makes watch work for -dev agents.
This commit is contained in:
parent
6f03545082
commit
0d550ff4b8
|
@ -57,6 +57,7 @@ OUTER:
|
|||
if err != nil {
|
||||
// Perform an exponential backoff
|
||||
failures++
|
||||
p.lastIndex = 1
|
||||
retry := retryInterval * time.Duration(failures*failures)
|
||||
if retry > maxBackoffTime {
|
||||
retry = maxBackoffTime
|
||||
|
|
Loading…
Reference in New Issue