You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f504227
Browse filesBrowse the repository at this point in the historyBrowse files
fix(providers): hand a ready device only to callers still within budget
Second review round on the shared lease table:
- A ready answer goes to a caller only while that caller's own signal
and deadline still hold, so a caller whose deadline passed before its
timer ran is not handed a device; nobody waiting means it is stopped.
- The session a start rented is recorded even when nobody takes it, so a
release that ended the start reports the device (Revyl: `revylRunId`).
- A caller whose budget is already spent sends no start.
- Shutdown repeats its drain until it has ended every entry, including
one a recovery or release opened while it ran.
- Revyl carries its platform in the lease request, names its cap
`REVYL_ALLOCATION_TIMEOUT_MS` with a margin over start plus readiness,
and builds its driver with `createRevylLeaseDriver`.
- ADR 0007 records the inventory and interactor effect of the fence, the
`provider-lease-releasing` reason and Revyl's in-process digest change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/adr/0007-remote-device-leases.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
Accepted
6
6
7
-
Decision history: 2026-10-21, a `macos-app` lease session takes its app device's claim instead of no claim, so exclusion against whole-Mac and same-app sessions also holds across daemons (ADR 0035, #3323). 2026-11-02, the Revyl provider runtime serves its lease lifecycle from a shared lease table instead of a table of its own (#4102).
7
+
Decision history: 2026-10-21, a `macos-app` lease session takes its app device's claim instead of no claim, so exclusion against whole-Mac and same-app sessions also holds across daemons (ADR 0035, #3323). 2026-11-02, the Revyl provider runtime serves its lease lifecycle from a shared lease table instead of a table of its own, and its runtime-owner instance widens to the shared 32-byte digest, which Revyl keeps in-process only (#4102).
8
8
9
9
## Rules at a glance
10
10
@@ -167,10 +167,10 @@ The provider supplies its start timeout, an optional stop timeout, start, stop,
167
167
The table owns the rules that decide whether a billed device is still rented:
168
168
169
169
- One lease id has at most one start. Overlapping allocations join it, and a ready session is reused.
170
-
- Each caller waits until the earlier of its own deadline and the start timeout. A caller that gives up stops nothing. A ready device goes to the callers still waiting, and it is stopped when no caller waits.
170
+
- Each caller waits until the earlier of its own deadline and the start timeout. A caller whose budget is already spent sends no start. A caller that gives up stops nothing. A ready device goes to the callers still waiting within their budgets, and it is stopped when no caller waits.
171
171
- A start can publish its rental before it answers. A teardown waits for the answer for at most the start timeout, then stops the published rental and keeps the lease pending until the answer arrives.
172
-
- Release, recovery, a failed start, and shutdown each end a lease through one teardown that all of them join. The teardown fences the lease in the same step: from then on, an allocation of the lease is refused, including an allocation that was already waiting.
173
-
- A teardown forgets a lease only after the provider confirmed the stop of every rental that it knows. A failed or late stop keeps the lease for the next teardown, which joins the stop still in flight. Shutdown reports what stays rented with `provider-cleanup-pending`.
172
+
- Release, recovery, a failed start, and shutdown each end a lease through one teardown that all of them join. The teardown fences the lease in the same step: from then on, an allocation of the lease is refused, including an allocation that was already waiting, and the device inventory and interactor no longer serve the lease. Revyl reports the refusal as `provider-lease-releasing`.
173
+
- A teardown forgets a lease only after the provider confirmed the stop of every rental that it knows. A failed or late stop keeps the lease for the next teardown, which joins the stop still in flight. Shutdown also ends every lease that a recovery or release opens while it drains, and it reports what stays rented with `provider-cleanup-pending`.
174
174
- If a start fails without an answer, or a recovery finds no entry, the teardown asks find-by-lease. If the provider cannot name the rental, the lease stays pending, and the next teardown asks again.
175
175
176
176
A table in each provider was rejected: each provider derived the same rules again, and most review findings on the second provider (#4092) were about that bookkeeping.
0 commit comments