Skip to content

Commit

Permalink
fix: don't immediately schedule monitoring after streaming failure
Browse files Browse the repository at this point in the history
When a failure occurs while streaming topology updates, we need to
wait some time before restarting the monitoring protocol. It's
likely that if some error closed the connection, an immediate
attempt to reconnect will also fail, leading to tight failure
loops.

NODE-2711
  • Loading branch information
mbroadst committed Jul 16, 2020
1 parent 9dee21f commit 7a3b99b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sdam/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ class Monitor extends EventEmitter {
const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS;
this[kMonitorId] = makeInterruptableAsyncInterval(monitorServer(this), {
interval: heartbeatFrequencyMS,
minInterval: minHeartbeatFrequencyMS,
immediate: true
minInterval: minHeartbeatFrequencyMS
});
}

Expand Down

0 comments on commit 7a3b99b

Please sign in to comment.