Page MenuHomePhabricator

Allow Drydock leases to expire after a time limit
ClosedPublic

Authored by epriestley on Sep 23 2015, 8:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 12:25 PM
Unknown Object (File)
Wed, Nov 20, 12:25 PM
Unknown Object (File)
Sat, Nov 16, 2:42 AM
Unknown Object (File)
Tue, Oct 29, 6:31 AM
Unknown Object (File)
Sun, Oct 27, 12:25 PM
Unknown Object (File)
Sat, Oct 26, 5:19 AM
Unknown Object (File)
Oct 8 2024, 6:30 PM
Unknown Object (File)
Oct 1 2024, 2:26 AM
Subscribers

Details

Summary

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

Repository
rP Phabricator
Lint
Lint Not Applicable
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.
src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
18–20

align?

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.
src/infrastructure/daemon/workers/PhabricatorWorker.php
122

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 (https://secure.phabricator.com/source/phabricator/browse/master/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php$226), so setting leaseExpire without setting leaseOwner looks like not to yield any delay at all...