bahir-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emlaver <>
Subject [GitHub] bahir pull request #49: BAHIR-130
Date Thu, 24 Aug 2017 15:01:23 GMT
Github user emlaver commented on a diff in the pull request:
    --- Diff: sql-cloudant/src/main/scala/org/apache/bahir/cloudant/common/JsonStoreDataAccess.scala
    @@ -125,6 +125,19 @@ class JsonStoreDataAccess (config: CloudantConfig)  {
         val clRequest: HttpRequest = getClRequest(url, postData)
         val clResponse: HttpResponse[String] = clRequest.execute()
    +    //BAHIR-130 start
    +    //In cloudant Lite number of requests pre second are limited.
    +    //Just wait and try again
    +    clResponse.code match {
    +        case 429 => {
    +            Thread sleep 1000
    --- End diff --
    For each retry we should consider increasing the sleep 'backoff' time.  Use something
like `long sleepTime = initialSleep * Math.round(Math.pow(2, attempt))` to double the sleep
time based on the number of retry attempts.  Our other libraries start with an initial sleep
time of 250 ms.  Here's the [retry method](
in our java library that may be helpful.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message