Skip to content

Cannot prevent RetryHandler from performing retries when response has HTTP status code of 429 or 503 or 504 #638

@AndrewBennet

Description

@AndrewBennet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done ✔️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions