Held while the work runs, released when it ends
withLock takes the lease, renews it at about a third of the TTL, and releases it when your callback returns. If a renewal fails, it aborts the signal it handed your callback, so the work stops instead of carrying on without the lock.
- TTLs from 5 seconds to 90 days
- A held lock answers acquired: false, it never blocks
- A crashed holder's lease expires on its own
await volcano.locks.withLock('nightly-rollup', { ttl: 30 }, run)acquired expires in 30s · fencing 4503599627370497renewed expires in 30srenewed expires in 30sreleased · the next run can take it