Page MenuHomePhabricator

Give Drydock resources a proper expiry mechanism
ClosedPublic

Authored by epriestley on Sep 28 2015, 1:06 PM.
Tags
None
Referenced Files
F13143320: D14176.diff
Fri, May 3, 7:23 AM
Unknown Object (File)
Thu, Apr 25, 1:31 AM
Unknown Object (File)
Fri, Apr 19, 3:38 PM
Unknown Object (File)
Thu, Apr 11, 9:03 AM
Unknown Object (File)
Thu, Apr 11, 9:03 AM
Unknown Object (File)
Mon, Apr 8, 7:52 AM
Unknown Object (File)
Fri, Apr 5, 3:12 PM
Unknown Object (File)
Mar 31 2024, 3:24 PM
Subscribers
None

Details

Summary

Fixes T6569. This implements an expiry mechanism for Drydock resources which parallels the mechanism for leases.

A few things are missing that we'll probably need in the future:

  • An "EXPIRES" command to update the expiration time. This would let resources be permanent while leased, then expire after, say, 24 hours without any leases.
  • A callback like shouldActuallyExpireRightNow() for resources and leases that lets them decide not to expire at the last second.
  • A callback like didAcquireLease() for resource blueprints, to parallel didReleaseLease(), letting them clear or extend their timer.

However, this stuff would mostly just let us tune behaviors, not really open up new capabilities.

Test Plan

Changed host resources to expire after 60 seconds, leased one, saw it vanish 60 seconds later.

Diff Detail

Repository
rP Phabricator
Branch
drydock20
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 8071
Build 9174: [Placeholder Plan] Wait for 30 Seconds
Build 9173: arc lint + arc unit

Event Timeline

epriestley retitled this revision from to Give Drydock resources a proper expiry mechanism.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: chad, hach-que.

Couple of cleanup / miscellaneous things in this diff too, notes inline...

src/applications/drydock/capability/DrydockDefaultViewCapability.php
11–13

This allows the default view policy to be "Public".

src/applications/drydock/controller/DrydockConsoleController.php
17

I removed "Logs" from the console because it needs work and it's hard to do policies + performance correctly from the web UI. I plan to realign logs as children of resources/leases in the web UI (they already are, to some degree, but I'll reinforce this).

I also added icons since they look nice and are consistent with Almanac.

src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php
41–47

Without this, yields from bin/worker execute ... would be computed incorrectly and scheduled some time in 1970. This only affects debugging with bin/worker.

chad edited edge metadata.
This revision is now accepted and ready to land.Sep 28 2015, 3:26 PM
This revision was automatically updated to reflect the committed changes.