HomePhabricator

Don't reclaim resources that have a destroyed lease less than 3 minutes old

Description

Don't reclaim resources that have a destroyed lease less than 3 minutes old

Summary:
Ref T13676. The 3-minute grace period when a resource can not be reclaimed after its leases are released currently doesn't work reliably because the Resource object usually isn't actually updated when a lease is released.

Add an additional check for recently-destroyed leases, and extend the grace period if we find any.

Test Plan:

  • See T13676. Ran reproduction sequence there, observed immediate resource reclamation.
  • Applied patch.
  • Ran sequence again, observed repository B wait 3 minutes to reclaim a repository A resource.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13676

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