1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/applications/drydock/management
epriestley 7168d8edd9 Make Drydock reclaim unused resources when it reaches a resource limit
Summary:
Fixes T9994. Currently, when Drydock can't allocate a new resource because some limit has been reached, it waits patiently for a resource to become available.

It is possible that no resource will ever become available. Particularly with "Working Copy" resources, the new lease may want a copy of `rB`, but the resource may already be maxed out on `rA`.

Right now, no process exists to automatically reclaim the unused `rA`.

When we encounter this situation, try to reclaim one of the other resources if it is just sitting there unused.

Specifically:

  - Add a "reclaim" command which means "release this resource //if// it is completely unused".
  - Add a `bin/drydock reclaim` to send this command to every active resource.
  - When we try to acquire a resource and can't, but only because of some kind of limit / utilization problem, try to release an unused resource to free up some room.

Test Plan:
  - Set "Working Copy" resource limit to 1.
  - Ran "Test Configuration" in `rA`, which worked.
  - Ran "Test Configuration" in `rB`, which hung forever.
  - Applied patch.
  - Ran "Test Configuration" in `rB`, saw it reclaim the `rA` resource, use the slot, then succeed.
  - Ran "Test Configuration" in `rA` again, saw it grab the slot back.
  - Ran `bin/drydock reclaim` and saw it reclaim a bunch of old orphaned resources.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9994

Differential Revision: https://secure.phabricator.com/D14819
2015-12-18 11:55:51 -08:00
..
DrydockManagementCommandWorkflow.php Allow AlmanacHost blueprints to build a meaningful CommandInterface 2015-09-21 04:46:02 -07:00
DrydockManagementLeaseWorkflow.php Use Drydock authorizations when acquiring leases 2015-10-12 17:02:35 -07:00
DrydockManagementReclaimWorkflow.php Make Drydock reclaim unused resources when it reaches a resource limit 2015-12-18 11:55:51 -08:00
DrydockManagementReleaseLeaseWorkflow.php Add a command queue to Drydock to manage lease/resource release 2015-09-23 07:42:08 -07:00
DrydockManagementReleaseResourceWorkflow.php Add a command queue to Drydock to manage lease/resource release 2015-09-23 07:42:08 -07:00
DrydockManagementUpdateLeaseWorkflow.php Add a command queue to Drydock to manage lease/resource release 2015-09-23 07:42:08 -07:00
DrydockManagementUpdateResourceWorkflow.php Add a command queue to Drydock to manage lease/resource release 2015-09-23 07:42:08 -07:00
DrydockManagementWorkflow.php Apply some autofix linter rules 2014-09-10 06:55:05 +10:00