Page MenuHomePhabricator

Merge the DrydockResource workers into a single worker
ClosedPublic

Authored by epriestley on Sep 30 2015, 7:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 7:25 PM
Unknown Object (File)
Sun, Dec 8, 8:32 AM
Unknown Object (File)
Wed, Nov 27, 3:21 PM
Unknown Object (File)
Sun, Nov 24, 5:16 PM
Unknown Object (File)
Wed, Nov 20, 12:30 PM
Unknown Object (File)
Wed, Nov 20, 12:30 PM
Unknown Object (File)
Wed, Nov 20, 12:30 PM
Unknown Object (File)
Nov 18 2024, 8:36 PM
Subscribers
None

Details

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Merge the DrydockResource workers into a single worker.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
  • Remove some status checks which test conditions which are now unreachable.
chad edited edge metadata.
This revision is now accepted and ready to land.Sep 30 2015, 8:36 PM