4 ms·
To counter the avalanche of retries on different layers, I have also seen a custom header being added to all requests that are retries. Upon receiving a request
by patrakov 2y ago
To counter the avalanche of retries on different layers, I have also seen a custom header being added to all requests that are retries. Upon receiving a request with this header, the microservice would turn off its own retry logic for this request.
- pyrolistical 2y agoYa. Instead of blind retries, I have server respond with “try after timestamp” header. This way it can tell everybody to back off. If no response then welp
- feyman_r 2y agoSending HTTP 429 is also a good way to ask that the error returned is not because of a downstream generic failure, but excess traffic. Having clients suspend retries altogether allows the service to come back up. Manual retries triggered from user action would be fresh requests.
- jcgrillo 2y agoFor the "no response" case, e.g. clients ignoring the retry-after header (or in the particular situation where I learned this trick, retrying aggressively on 401) one can implement an "err200" response in the load balancer which makes them all go away ;).