Homec4science

(stable) Retain repository update cooldowns across daemon restarts

Authored by epriestley <git@epriestley.com> on Sep 20 2016, 01:20.

Description

(stable) Retain repository update cooldowns across daemon restarts

Summary:
Ref T11665. Fixes T7865. When we restart the daemons, the repository pull daemon currently resets the cooldowns on all of its pulls. This can generate a burst of initial load when restarting a lot of instance daemons (as in the Phacility cluster), described in T7865. This smooths things out so that recent pulls are considered, and any repositories which were waiting keep waiting.

Somewhat counterintuitively, hosted repositories write TYPE_FETCH status messages, so this should work equally well for hosted and observed repositories.

This also paves the way for better backoff behavior on repository errors, described in T11665. The error backoff now uses the same logic that the standard backoff does. The next change will make backoff computation consider recent errors.

(This is technically too large for repositories which have encountered one error and have a low commit rate, but I'll fix that in the following change; this is just a checkpoint on the way there.)

Test Plan: Ran bin/phd debug pull, saw the daemon compute reasonable windows based on previous pull activity.

Reviewers: chad

Maniphest Tasks: T7865, T11665

Differential Revision: https://secure.phabricator.com/D16574

Details

Committed
epriestley <git@epriestley.com>Sep 20 2016, 02:30
Pushed
aubortJan 31 2017, 17:16
Parents
rPHc8281bc33927: (stable) Promote 2016 Week 38
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH554940b33f4f: (stable) Retain repository update cooldowns across daemon restarts (authored by epriestley <git@epriestley.com>).Sep 20 2016, 02:30