Ref T6569. If a lease is activated with an expiration date, schedule a task to try to clean it up after that time.
- Maniphest Tasks
- T6569: Implement proper expiry mechanism for Drydock resources
- Restricted Diffusion Commit
rP337990423740: Allow Drydock leases to expire after a time limit
- 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.
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.)
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...