-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request().WithShouldRetry is not called for failed requests. #190
Comments
From reading RetryHandler.cs file there appears to be inconsistency in the way the conditional operator is used w.r.t. Retry in SendAsync() and SendRetryAsync() method. In the below SendAsync() method the ShouldRetry() and RetryOption.ShouldRetry() is subjected to 'and' conditional operator, whereas in the SendRetryAsync() method the ShouldRetry() and RetryOption.ShouldRetry() is evaluated with 'or' conditional operator. SendAsync() method:
SendRetryAsync() method:
I am not sure if the above difference is intentional, if the objective of WithShouldRetry() is to provide independent custom evaluation then ShouldRetry() and RetryOption.ShouldRetry() should be using 'or' operator. The SendRetry() method should therefore be as below,
|
Hey, @spmanjunath! |
Closed via #242 |
@andrueastman I think there is a misunderstanding here. This issue raised 2 observations:
However, msgraph-sdk-dotnet-core/src/Microsoft.Graph.Core/Requests/Middleware/RetryHandler.cs Line 118 in 6e1a5a9
SendRetryAsync should also be handled (in feature 2.0) and that handling should be consistent with SendAsync conditional check changes, right?
|
@andrueastman I pulled the latest head on feature/2.0 branch, updated The updated test demonstrated see brcaswell#1 Pull Request that has these changes in it (in respect to branch off of feature 2.0 in forked repo) branch and repo link brcaswell/msgraph-sdk-dotnet-core:update-retryhandler-test |
@brcaswell Thanks for explaining this so well with the sample PR. |
@andrueastman yea, I can do that by creating a new PR.. it seems there is no supported way to retarget the base on that existing PR to target upstream repo branch. probably going to see duplicate mentions in this issue and referenced PR |
Expected behavior
i am trying to overcome intermittent 409 error that occurs while uploading/updating metadata of a file in SharePoint's Document library using Microsoft Graph SDK. To retry failed calls SDK provides WithMaxRetry() and WithShouldRetry() options. The MaxRetry works for error codes 429, and I am assuming that ShouldRetry delegate offers us an option to implement our own evaluation logic for the retries. Based on this assumption, I have the below code:
Actual behavior
In my test the ShouldRetry delegate is never evaluated on failed requests. I am not sure if the above usage is correct (i could not find any reference of its usage), please suggest otherwise.
Thanks.
AB#7188
The text was updated successfully, but these errors were encountered: