Giter Site home page Giter Site logo

Comments (5)

rnagpal avatar rnagpal commented on July 18, 2024

Hi Carson,

Thanks for reporting this issue.

Running these tests all at the same time might result in 429s as you see but I'm surprised that adding the delay of 15 secs between the tests is still causing the throttle. In the second case, are the same set of test cases failing? Probably, each of those tests are making several requests too soon causing the throttle within the same test case. Most of the collections in the tests should be S1 which support 250 RUs/second and I'd guess that would be sufficient for most of the test cases.

Performance tier is tied to a collection, so as long as you are creating new test collections there shouldn't be any impact of the other load(if any) on the same database.

We probably would need to add retry policy around 429s for these test cases, so that always succeed(even if they take time).

I'll add this to our backlog but feel free to contribute to it if you wish.

Regards,
Rajesh

from azure-cosmos-python.

carsonyl avatar carsonyl commented on July 18, 2024

Hi Rajesh. Thanks for the insight. I believe that the failures with the 15 second delay are a subset of the failures with no delay -- I didn't look too closely at the results because without any delay, about half the tests fail.

It would be great to have a retry policy for all the methods in pydocumentdb. I am open to contributing, but I'm not yet familiar enough with DocumentDB. This post mentions how the .NET API has built-in retry for 429 responses, and I see signs of this being implemented in some parts of pydocumentdb too. I may file another issue about this tomorrow, because I have some suspicions about whether it's working correctly.

from azure-cosmos-python.

rnagpal avatar rnagpal commented on July 18, 2024

The 2 slightly different versions of the error messages you were seeing for throttle scenarios was due to the fact that sometimes throttle is detected at the gateway level and Gateway sends RequestTooLargerException(the second one that you are seeing). The first one is coming directly from the server and hence has a slightly different message but since both of them have status code 429, they are due to the same reason.

It will be a while until we implement the throttle retry policy for all documentdb APIs for Python SDK but you can take a look at http://stackoverflow.com/questions/29275447/exception-microsoft-azure-documents-requestratetoolargeexception-while-querying as an example how that's implement in .NET SDK, so you may have to do similar thing for Python. In short, you catch the exception, check if it's status code is 429, get the value of "RetryAfterInMilliseconds" property from the response header and wait until that many ms, and resubmit the request. You can loop for say 3 times before giving up.

Meanwhile, we should be able to modify the tests so that each one of them doesn't creates a new collection every time. We can have one or two test collections created which are shared by most of the tests for creating resources within that collection and cleaning them up at the end. Collection creates are the only one which are causing problems in this case, so if we can eliminate that we should be good. We may be able to get to this approach in our next release but if you are comfortable enough to make these changes, feel free to do so and we will accept it as a PR.

Regards,
Rajesh

from azure-cosmos-python.

carsonyl avatar carsonyl commented on July 18, 2024

For now, I'm experimenting with the REST API without using pydocumentdb. I'll try implementing automatic retry based on your link - thanks.

from azure-cosmos-python.

rnagpal avatar rnagpal commented on July 18, 2024

@rbcarson : This issue has been fixed with 1.9.0 release. You should be able to run the tests without any custom retry logic.

from azure-cosmos-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.