Repository navigation
Conversation
Releasing a lease (tenant lease_release or host DELETE) or letting it expire left the session opened under it holding its device claim, so the next tenant's open failed with DEVICE_IN_USE and the owner could no longer close it. The daemon now tears that session down under its execution locks and clears the claim even when teardown fails, and sweeps the lease registry every second so expiry no longer waits for a later request.
|
Thanks for this. The fix for ending a session and clearing its claim when the lease ends looks right at 77f8e43, but I found a shutdown race that needs fixing first. The five checks on this commit pass. The PR has merge conflicts with main, because #3431 rewrote
Not blocking, and you can take or leave these: Simplicity question: could I did not run the tests or reproduce the live run, and I relied on your PR body output for it. I found the shutdown window by reading the code. Please rebase onto main first, then fence lease-end teardown against shutdown and rerun CI on the new head. I did not check how the change rebases onto #3431 or #3430. |
Summary
When a lease was released or expired, the session opened under it stayed alive and kept its device claim. Its owner could not
closeit, and the next tenant'sopenfailed withDEVICE_IN_USE. Expiry was only acted on by a later request, which often found nothing.Now, when a lease ends, the daemon tears down the session bound to it under that session's execution locks and clears its claim, even if teardown fails. This covers tenant
lease_release, hostDELETE /admin/leases/<id>, and expiry (onLeaseExpired, plus a 1 s sweep so no request is needed). In-flight work and human-control holds still keep a lease alive.closeandretainOnCloseare unchanged. Help text and ADR 0007 updated. 13 files.Validation
Tested commit
77f8e43.pnpm check:affected --run: all runnable checks passed (incl. layering, fallow, 2211 related tests).New tests fail without the fix and pass with it: release ends the session; host DELETE ends it; expiry ends it with no request (runtime timer); an unreachable device still loses its claim; release waits for a running command.
Live run on a private-set iOS simulator, two proxy tenants, local daemon:
Existing daemon and server suites pass (2010 tests). CI pending.