Skip to content
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

ClientRetryPolicy broken when executing stored procedure #118

Closed
dkroehan opened this issue May 14, 2019 · 9 comments
Closed

ClientRetryPolicy broken when executing stored procedure #118

dkroehan opened this issue May 14, 2019 · 9 comments

Comments

@dkroehan
Copy link

Describe the bug
When executing a stored procedure ( e.g. bulk-delete.js) via AsyncDocumentClient and the request runs into rate limiting then the retry mechanism throws an error.

Here is the log output:

2019-05-14 12:32:38.129 ERROR [-,,,] 28224 --- [o-eventloop-4-2] c.m.a.c.rx.internal.ClientRetryPolicy    : locationEndpoint is null because ClientRetryPolicy::onBeforeRequest(.) is not invoked, probably request creation failed due to invalid options, serialization setting, etc.
2019-05-14 12:32:38.131 ERROR [-,,,] 28224 --- [o-eventloop-4-2] i.RenameCollectionAwareClientRetryPolicy : onBeforeSendRequest is not invoked, encountered failure due to request being null

com.microsoft.azure.cosmosdb.DocumentClientException: Message: {"Errors":["Request rate is large"]}
...

To Reproduce
Execute bulk-delete.js stored procedure on a large enough dataset so that the execution runs into execution bounds (rate limiting).
In my case there were 500 documents to delete and the partition was configured with 400 RU/s. In the first execution 345 documents were successfully deleted. The described error occurred after executing the stored procedure a second time.

Expected behavior
In version com.microsoft.azure:azure-cosmosdb:2.4.4 everything is working correctly.
I get the following log output:

2019-05-14 13:03:33.363  WARN [-,,,] 28633 --- [o-eventloop-4-3] c.m.a.c.r.i.ResourceThrottleRetryPolicy  : Operation will be retried after 8569 milliseconds. Current attempt 1, Cumulative delay PT8.569S Exception: {}

The retry is performed automatically and the remaining documents are getting deleted.

Actual behavior
Error is thrown (see log output above) and no retry is performed.

Environment summary
Affected SDK Version: com.microsoft.azure:azure-cosmosdb:2.4.5. (Same for the 3.0.0-beta releases)

@kushagraThapar kushagraThapar self-assigned this May 15, 2019
@kushagraThapar kushagraThapar added this to To do in Cosmos DB SDK team via automation May 15, 2019
@christopheranderson
Copy link
Contributor

@kushagraThapar - have we looked at this?

@kushagraThapar
Copy link
Member

@dkroehan We did find some issues with retry policies, but we have fixed them in the latest version. Can you please re-confirm this in the latest versions, v2.6.3 and v3.3.1 ?

@dkroehan
Copy link
Author

dkroehan commented Oct 31, 2019

@kushagraThapar We recently updated to SDK v3 and I just checked it for the latest v3.3.1

Unfortunately the issue is not fixed. Here is the error output I get:

11:19:35.814 [reactor-http-epoll-4] ERROR c.a.d.c.internal.ClientRetryPolicy - locationEndpoint is null because ClientRetryPolicy::onBeforeRequest(.) is not invoked, probably request creation failed due to invalid options, serialization setting, etc.
11:19:35.817 [reactor-http-epoll-4] ERROR c.a.d.c.i.RenameCollectionAwareClientRetryPolicy - onBeforeSendRequest is not invoked, encountered failure due to request being null
com.azure.data.cosmos.CosmosClientException: Message: {"Errors":["Request rate is large"]}

Looks the same as in the first post.

@kushagraThapar
Copy link
Member

@dkroehan Thanks for checking it, I will investigate it this week.

@dkroehan
Copy link
Author

@kushagraThapar Do you have any update on this issue?

@kushagraThapar
Copy link
Member

kushagraThapar commented Dec 23, 2019

@kushagraThapar Do you have any update on this issue?

@dkroehan sorry this issue somehow got dropped from our tracking. I will track it now onwards.
We will pick it up in January.

As I get it, you are facing this issue both on V2 and V3 ?

@kushagraThapar
Copy link
Member

@dkroehan Since v3 SDK got moved from this repository to here: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos

I strongly suggest please create an issue here as well: https://github.com/Azure/azure-sdk-for-java/issues
You can mention me, and mention this issue as well. Its easy to triage issues there as there is a microsoft-bot which notifies us on new issue creations.
Once you create it there, I will make sure the fix gets ported to v2 as well.

@dkroehan
Copy link
Author

@kushagraThapar Created the new issue. Feel free to close it here.

@kushagraThapar
Copy link
Member

@kushagraThapar Created the new issue. Feel free to close it here.

Thanks, will close this one.

Cosmos DB SDK team automation moved this from To do to Done Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

3 participants