1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/drydock/worker
epriestley 91e5ca0ee2 Merge the DrydockResource workers into a single worker
Summary:
Ref T9252. Currently, Drydock Leases and Resources have several workers:

  - Resources: ResourceWorker, ResourceUpdateWorker, ResourceDestroyWorker
  - Leases: AllocatorWorker, LeaseWorker, LeaseUpdateWorker, LeaseDestroyWorker

This is kind of a lot of stuff, and it creates some problems.

In particular, leases and resources in early lifecycle phases (pending/allocating/acquiring) can't process commands yet, because that code is only in the "UpdateWorker" classes. If they aren't able to move forward because of a bug, they also can't be released because they can't react to the release command until later in their lifecycle. This creates a soft hang where I have to go wipe stuff out of the database since there's no other way to get rid of it.

Instead, I want leases and resources to be releasable from any (pre-release / pre-destroy) phase of their lifecycle. To support this, all the workers before the "UpdateWorker" need to be able to process commands.

A second, similar issue is that logging and exception handling behaviors are underpowered right now. Elsewhere I began improving this, but ran into issues where all of the workers needed to share very similar exception code. Merging them will make this future change simpler.

This diff fixes this for resources: it merges the Worker, UpdateWorker and DestroyWorker logic into UpdateWorker and throws away the other two workers.

Test Plan: Nothing substantive yet, see next diff. I'll do the same thing for Leases, then test both more thoroughly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9252

Differential Revision: https://secure.phabricator.com/D14201
2015-10-01 08:10:40 -07:00
..
DrydockAllocatorWorker.php Merge the DrydockResource workers into a single worker 2015-10-01 08:10:40 -07:00
DrydockLeaseDestroyWorker.php Add Drydock log types and more logging 2015-10-01 08:10:07 -07:00
DrydockLeaseUpdateWorker.php Add Drydock log types and more logging 2015-10-01 08:10:07 -07:00
DrydockLeaseWorker.php Convert Drydock lease and resource constants to strings 2015-09-24 07:57:05 -07:00
DrydockResourceUpdateWorker.php Merge the DrydockResource workers into a single worker 2015-10-01 08:10:40 -07:00
DrydockWorker.php Merge the DrydockResource workers into a single worker 2015-10-01 08:10:40 -07:00