OpenBazaar / multiwallet

API based multi-cryptocurrency wallet
MIT License
72 stars 41 forks source link

Track health of servers in the client/pool to prevent stampeding the same server #46

Closed placer14 closed 5 years ago

placer14 commented 5 years ago

In the case where the pool experiences a failure on every server (especially apparent when pool size is 1), the pool does not back-off on a very recently failed request, causing a stampede effect on that server. Instead, we should be tracking the health of each server in the pool and exponentially backing off on those requests. There may be different classes of requests which require different backoff handling, but that is outside the scope of this feature.

For now, any failure which would normally trigger a rotation, should be recorded and considered when making a request at a "recently-failed" server.