Even when supplying a RetryHandlerOption with a ShouldRetry that always returns false, the library still retries when the response has HTTP status code of 429, 503, 504. This is because the logic for initiating a retry does an OR between the result of a private ShouldRetry method and the supplied options' ShouldRetry Func. The private method returns true for statuses of 429, 503 and 504, and thus the overall "should retry" logic always returns true for thoses statuses, even if we supply an option that sets ShouldRetry to false for those statuses.
The only workaround I have found is to supply a RetryHandlerOption object with MaxRetry = 0, since that check is done regardless of the response status.
Even when supplying a
RetryHandlerOptionwith aShouldRetrythat always returns false, the library still retries when the response has HTTP status code of 429, 503, 504. This is because the logic for initiating a retry does an OR between the result of a privateShouldRetrymethod and the supplied options' ShouldRetry Func. The private method returns true for statuses of 429, 503 and 504, and thus the overall "should retry" logic always returns true for thoses statuses, even if we supply an option that sets ShouldRetry to false for those statuses.The only workaround I have found is to supply a
RetryHandlerOptionobject withMaxRetry = 0, since that check is done regardless of the response status.