-
-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makeBackoffMachine: Improve backoff sleep logic by making it local.
Fixes: 3840. Replace progressiveTimeout with makeBackoffMachine, which is called above a loop, and .wait() can be called inside the loop on the returned backoffMachine. Give access to numSleepsCompleted and timeElapsedSoFar so "give up" logic (e.g., on too many network requests with transient failures) can be handled near .wait() call sites. Prepare for work on #3829 (a permanent timeout on sending outbox messages). Previously, the state logic in progressiveTimeout was global, which meant a potentially desirable general throttle on all network requests that used it, but the drawbacks were greater. A particular call to progressiveTimeout was nondeterministic, because other calls may have been made recently, affecting the resulting delay duration. A 60-second threshold was used as a heuristic to distinguish request retry loops from each other, but this is much more effectively done with the new interface.
- Loading branch information
Chris Bobbe
committed
Jan 25, 2020
1 parent
5e290d0
commit 126adf4
Showing
4 changed files
with
77 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters