Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: disregard failed pings in updateLatency() for cluster nodes
It is possible that a ping command might fail very quickly due to an immediate connection refused message or some other server failure condition. In this case, the derived latency is not reliable and should not be used to compare this node to other nodes in the cluster. This change will only count successful Ping commands in the average latency and in the case of no successful Pings, set the latency to an arbitrarily high value to make this node have the least priority when routing by latency.
- Loading branch information