RelationalAI / rai-sdk-csharp

The RelationalAI Software Development Kit (SDK) for C#
Apache License 2.0
0 stars 1 forks source link

Fix retry policy for HttpError's #62

Closed Zlata-Zueva closed 1 year ago

Zlata-Zueva commented 1 year ago

One of the recently merged PRs: changed the retry Policy for 4xx status codes. Previously ApiException was only thrown on 5xx status codes, therefore 4xx status codes were immediately propagated back to user - which is expected behavior. But now that HttpError is thrown on 4xx status codes as well, the policy is retrying 5 times before actually throwing exceptions (i.e. with 404 errors) back to user.

This PR returns the previous behavior back.

torkins commented 1 year ago

Just for posterity, want to note this:

I actually don't like the original code and this change is an improvement but it makes no sense to always retry HTTP calls on even 5xx errors. Really only specific ones, probably Only 502/3/4. However this PR is an improvement on the situation and resolves a client perf issue

stanislav-bedunkevich commented 1 year ago

@torkins @NRHelmi is this ready to go? If so could you please get this released?

NRHelmi commented 1 year ago

@torkins @NRHelmi is this ready to go? If so could you please get this released?

@stanislav-bedunkevich will merge and release, thanks @Zlata-Zueva again for the fix