Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
profiler: increase and simplify backoff (#827)
The current backoffDuration is designed to deal with optimistic concurrency control, which is not what we're trying to do. More importantly, we're only doing a single retry right now if the first attempt failed, so backoffDuration() call always returns 100ms +/- some jitter. This means that the moment there is an upstream issue we immediately spam the upstream service with a second request which is usually counter-productive. This patch simply sleeps for rand(0, profilePeriod). The profile period by default is 60s, so on average we'll sleep for 30s, i.e. even space out our attempt to upload the profile. Attached to the PR are two illustrations that show the old and new behavior in a simple simulation.
- Loading branch information