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 b6aa27b
Browse filesBrowse the repository at this point in the historyBrowse files
fix(providers): stop a released Revyl start without waiting out readiness
A release, recovery or shutdown that took over a lease mid-start waited
for the start to finish readiness before it could stop the device, up
to Revyl's whole allocation timeout. The table now aborts the start's
own signal as soon as a teardown takes the lease, since no caller can
receive that device any more, and reports the lease's end, not the
aborted start, to callers still waiting. Revyl publishes its session
through `control.rented` the moment `start_device` answers with it, the
first moment Revyl holds it, and a release of a session that never
became ready still reports its run id.
New test: a release during a stalled readiness stops the device at
once. The two table tests the seeded sweep fully covers are folded into
it to keep the change within its budget, and Revyl's lease tests share
one refusal helper to stay within the file's line cap.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/adr/0007-remote-device-leases.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ 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 whose budget is already spent sends no start. A caller that gives up stops nothing. The start runs while any caller still waits, for at most the start timeout: no single caller's signal or deadline reaches it, and the table tells the provider to abandon it once no caller waits. A ready device goes to the callers still waiting within their budgets, and it is stopped when no caller waits. Each caller's budget is checked when the session is handed over, on reuse as well.
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. The start runs while any caller still waits, for at most the start timeout: no single caller's signal or deadline reaches it, and the table tells the provider to abandon it once no caller waits or the lease starts ending. A ready device goes to the callers still waiting within their budgets, and it is stopped when no caller waits. Each caller's budget is checked when the session is handed over, on reuse as well.
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
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 a refusal for a lease that a release, a recovery, or a failed start is ending as `provider-lease-releasing`, and a refusal after shutdown began as `runtime-shutting-down`.
173
173
- A teardown forgets a lease only after the provider confirmed the stop of every rental that it knows. It stops them one at a time, in the order they were named, and a rental named while a teardown settles gets a teardown of its own. A failed or late stop keeps the lease for the next teardown, which joins the stop still in flight. Shutdown is a fence: from then on, an allocation, or a recovery of a lease that has no entry, is refused with `runtime-shutting-down`, and a release only joins an entry that already exists, so one drain pass ends every entry. It reports what stays rented with `provider-cleanup-pending`.
0 commit comments