Homec4science

Merge the DrydockResource workers into a single worker

Authored by epriestley <git@epriestley.com> on Oct 1 2015, 17:10.

Description

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

Details

Committed
epriestley <git@epriestley.com>Oct 1 2015, 17:10
Pushed
aubortJan 31 2017, 17:16
Parents
rPH8bf59050247d: Add Drydock log types and more logging
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH91e5ca0ee28c: Merge the DrydockResource workers into a single worker (authored by epriestley <git@epriestley.com>).Oct 1 2015, 17:10