timoklimmer / documentdbr

Use Azure DocumentDB from R

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically recover from 429

filipsch opened this issue · comments

Your package is extremely simple to use, thanks for this!!

When doing repeated document queries to our documentDB instance, I get the following 429 error in an unpredictable fashion (probably because one of our other services is performing actions?):

Error in selectDocuments(connectionInfo, queryText = query, enableCrossPartitionQuery = TRUE) : 
  A 429 error occured during DocumentDB querying. Error Message: Message: {"Errors":["Request rate is large"]}
ActivityId: b2cfdc24-5b03-4eab-b6c8-c84e94d67d79, Request URI: /apps/514defcb-ac21-44e6-a8e0-c7b785523c6c/services/23357e57-84ba-4eb6-adc1-6df21ed8b5b4/partitions/6b5f2f77-b2b3-4dc0-a698-4d4ee891684a/replicas/131681651295792435s/, RequestStats: 
ResponseTime: 2018-05-01T14:21:57.1720496Z, StoreReadResult: StorePhysicalAddress: rntbd://bl4prdddc02-docdb-1.documents.azure.com:14294/apps/514defcb-ac21-44e6-a8e0-c7b785523c6c/services/23357e57-84ba-4eb6-adc1-6df21ed8b5b4/partitions/6b5f2f77-b2b3-4dc0-a698-4d4ee891684a/replicas/131681651295792435s/, LSN: 8841342, GlobalCommittedLsn: 8841341, PartitionKeyRangeId: , IsValid: True, StatusCode: 0, IsGone: False, IsNotFound: False, IsInvalidPartition: False, RequestCharge: 0.38, ItemLSN: -1, ResourceType: Document, OperationType: Query
, SDK: Microsoft.Azure.Documents.Common/1.22.0.0

Is there a way in your package to keep retrying until the query executes? If not, I'm happy to do a PR if you can provide some pointers on where you think this functionality should be added.

Thanks!

Hey, I'm not sure this repo is actively maintained, but I was having a similar issue when I was using it on a project a while back. I submitted a PR, but never heard anything from the maintainer so I closed it. You could check out the code, might be of some use.

@davefrancis I saw, very useful indeed. I'll probably just fork the package and apply the subset of your changes that I need there. Thanks!