Page MenuHomePhabricator

When repositories hit pull errors, stop updating them as frequently

Authored by epriestley on Sep 20 2016, 12:28 AM.
Referenced Files
F13466318: D16575.diff
Tue, Jul 16, 9:24 AM
F13458582: D16575.id39896.diff
Mon, Jul 15, 1:37 AM
Wed, Jul 10, 10:17 AM
F13354637: D16575.id39895.diff
Mon, Jun 24, 6:44 AM
F13346118: D16575.diff
Fri, Jun 21, 1:28 PM
F13340109: D16575.diff
Wed, Jun 19, 10:59 PM
F13289280: D16575.id39896.diff
Jun 4 2024, 11:51 AM
F13258164: D16575.id39895.diff
May 26 2024, 7:13 AM



Ref T11665. Currently, when a repository hits an error, we retry it after 15s. This is correct if the error was temporary/transient/config-related (e.g., bad network or administrator setting up credentials) but not so great if the error is long-lasting (completely bad authentication, invalid URI, etc), as it can pile up to a meaningful amount of unnecessary load over time.

Instead, record how many times in a row we've hit an error and adjust backoff behavior: first error is 15s, then 30s, 45s, etc.

Additionally, when computing the backoff for an empty repository, use the repository creation time as though it was the most recent commit. This is a good proxy which gives us reasonable backoff behavior.

This required removing the CODE_WORKING messages, since they would have reset the error count. We could restore them (as a different type of message), but I think they aren't particularly useful since cloning usually doesn't take too long and there's more status information avilable now than there was when this stuff was written.

Test Plan
  • Ran bin/phd debug pull.
  • Saw sensible, increasing backoffs selected for repositories with errors.
  • Saw sensible backoffs selected for empty repositories.

Diff Detail

rP Phabricator
Lint Passed
Tests Passed
Build Status
Buildable 13775
Build 17795: Run Core Tests
Build 17794: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to When repositories hit pull errors, stop updating them as frequently.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
This revision was automatically updated to reflect the committed changes.