Page MenuHomePhabricator

Adjust the Drydock allocator to limit each pending lease to one allocating resource

Authored by epriestley on May 9 2022, 5:24 PM.
Referenced Files
Sun, Sep 24, 6:30 PM
F12194224: D21807.id51975.diff
Sun, Sep 24, 6:16 PM
F12194171: D21807.id51977.diff
Sun, Sep 24, 5:09 PM
F12194169: D21807.id51981.diff
Sun, Sep 24, 5:04 PM
F12194038: D21807.diff
Sun, Sep 24, 12:10 PM
F12192672: D21807.diff
Sat, Sep 23, 2:41 AM
F12186008: D21807.diff
Sat, Sep 16, 4:01 PM
F12162500: D21807.diff
Wed, Sep 6, 8:21 PM
Restricted Owners Package



Ref T13677. Currently, one lease may cause multiple resources to allocate simultaneously if it starts allocating one, then wakes up from a yield later on and still sees no available resources.

This is never desired -- or, at least, produces desirable behavior only entirely by accident. Normally, it causes an excess of resources to allocate.

This is not a catastrophic problem: the extra resources usually get used sooner or later or cleaned up; and the total amount of badness is limited by overall resource allocation limits.

However, this behavior is also suppressed by an artificial "25% of current pool size" growth limit throttle which I intend to remove. Removing this throttle without fixing the allocator behavior could make this "too many resources" problem worse.

Change the allocator so that a lease that has started allocating a resource won't allocate another resource until the first resource leaves the "pending" state.

This also fixes some general oddness with the allocator and attempts to simplify the structure.

Test Plan
  • Ran 8 taskmasters.
  • Destroyed all resources and leases.
  • Leased 4 working copies.
    • Saw exactly 4 resources build and lease, all simultaneously.
  • Destroyed all resources and leases.
  • Leased 32 working copies.
    • Saw exactly 32 resources build and lease, approximately 8 at a time (limited by taskmasters).
  • Destroyed all leases (but not resources).
  • Leased 32 working copies, saw them satisfied by existing resources.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable

Event Timeline

Owners added a subscriber: Restricted Owners Package.May 9 2022, 5:24 PM
  • Fix some variable names and exception handling.