Page MenuHomePhabricator

Allow Drydock leases to expire after a time limit

Authored by epriestley on Sep 23 2015, 8:16 PM.



Ref T6569. If a lease is activated with an expiration date, schedule a task to try to clean it up after that time.

Test Plan
  • Used bin/drydock lease ... --until ... to activate a lease in the near future.
  • Waited for a bit.
  • Saw it expire and get destroyed at the scheduled time.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley retitled this revision from to Allow Drydock leases to expire after a time limit.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: chad, hach-que.
chad edited edge metadata.
chad added inline comments.


This revision is now accepted and ready to land.Sep 23 2015, 8:32 PM

I'm intentionally moving away from aligning stuff in the middle of blocks because it messes with blame and generally tends to produce churn without much benefit.

(In theory, blame would be smarter, and there is git blame -w which is somewhat smarter, but in practice I think it's easier to just not align things.)

This revision was automatically updated to reflect the committed changes.
artms added inline comments.

If queue is empty and this is the only task into the queue - it will be immediately executed - is this expected behavior?

By default PhabricatorWorkerLeaseQuery fetches unleased tasks which are leaseOwner IS NULL ($226), so setting leaseExpire without setting leaseOwner looks like not to yield any delay at all...