Repository navigation
Commit ffc2599
committed
fix(daemon): let a waiting open re-wait when the device is retaken
An `--wait` budget ended as soon as no session held the device, but nothing
reserved the device until the request took its execution lock, so two waiters
could both see one free device and the loser refused with most of its budget
left. The open now looks at the device again under its own locks, hands them
back when another session took it in that window, and waits for what remains of
its budget. The recorded spend moves to that same look, so only a budget that
ran out with a holder visible reports a spent wait, and a refusal stops offering
`--wait` to a caller that arrived carrying it.
The target device is resolved once, as part of the request's execution-lock
plan, and contention is polled in the session store alone. A budget that reaches
the daemon anywhere but through the CLI is now checked against the bounds the
option declares, which the Node client never enforced.1 parent da2d5f8 commit ffc2599
14 files changed
Lines changed: 587 additions & 232 deletions
File tree
- packages
- command-registry/src
- contracts/src
- src/daemon
- __tests__
- session-lifecycle/internal
- test/integration/nightly
- concurrency-torture
- website/docs/docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
0 commit comments