Github user sagelywizard commented on a diff in the pull request:

    
https://github.com/apache/couchdb-couch-replicator/pull/40#discussion_r66891414
  
    --- Diff: src/couch_replicator_httpc.erl ---
    @@ -251,16 +258,41 @@ clean_mailbox(_, Count) when Count > 0 ->
     maybe_retry(Error, Worker, #httpdb{retries = 0} = HttpDb, Params) ->
         report_error(Worker, HttpDb, Params, {error, Error});
     
    +%% For 429 errors, we perform an exponential backoff up to 250 * 2^15
    +%% times, or roughly 2.17 hours. Since the #httpd.retries is initialized
    +%% to 10 and we need 15, we use the Wait time as a timeout/failure end.
    +maybe_retry(backoff, Worker, #httpdb{wait = Wait} = HttpDb, Params) ->
    +    ok = timer:sleep(random:uniform(Wait)),
    +    Wait2 = Wait*2,
    +    case Wait2 of
    +        W0 when W0 >= ?MAX_BACKOFF_LOG_THRESHOLD -> % Past 8 min, we log 
retries
    +            log_retry_error(Params, HttpDb, Wait, "429 Retry");
    --- End diff --
    
    Don't we still need to `throw({retry...` here?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to