Repository navigation
Commit 4176e54
committed
fix(apple-runner): fence prep spawns behind a start-owned admission (#3220)
A non-retained close killed the in-flight `build-for-testing` before
waiting for the session lock the start holds, and the same caller's
health retry answered the kill with a second build while close waited —
close timed out on the build it just asked to stop.
One start-owned admission now answers who may prepare a device: it is
captured when a start requests the device, shared by every start that
queues behind that work, closed by a teardown BEFORE it stops prep
children or takes the session lock, and closed by the LAST interested
waiter's cancellation while any other waiter still preserves the work.
The preparation-spawn seam and the session-publish points both read it
immediately before they act, so a retired start's retry is refused
before the replacement child exists, and a retired start can never
publish into a fresh start. A start that merely QUEUED behind a close
re-routes to a fresh admission once that close has settled — the fence
refuses mid-close retries, never innocent waiters; the settle clears
the fence inside the session lock.
The starting request counts as an interested waiter even on surfaces
that pass no caller signal, so a joiner's cancellation cannot outvote
the live owner and stop its build.
Removed the #3193 request-owner prep filter
(`runnerPrepProcessChildrenWithoutActiveOwner` /
`stopRunnerPrepProcessesWithoutActiveOwner`): the admission's waiter
count supersedes the owner-liveness sniff. The shutdown-detach
mechanism moved to runner-adoption.ts beside the adoption it hands off
to (pure move).
Closes #32201 parent 14e1bd7 commit 4176e54
16 files changed
Lines changed: 1516 additions & 364 deletions
File tree
- apple/runner/AgentDeviceRunner/RecordingScripts
- packages
- capture-kit/src/recording
- __tests__
- platform-apple/src/runner
- __tests__
- src/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 91 | + | |
| 92 | + | |
97 | 93 | | |
98 | 94 | | |
99 | | - | |
100 | 95 | | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
106 | 101 | | |
107 | | - | |
| 102 | + | |
108 | 103 | | |
109 | 104 | | |
110 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | 148 | | |
150 | 149 | | |
151 | 150 | | |
| |||
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
| 160 | + | |
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
166 | 164 | | |
167 | 165 | | |
168 | 166 | | |
| |||
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | 188 | | |
198 | 189 | | |
199 | 190 | | |
200 | 191 | | |
201 | 192 | | |
202 | 193 | | |
203 | 194 | | |
204 | | - | |
| 195 | + | |
205 | 196 | | |
206 | 197 | | |
207 | | - | |
| 198 | + | |
208 | 199 | | |
209 | 200 | | |
210 | 201 | | |
| |||
338 | 329 | | |
339 | 330 | | |
340 | 331 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 332 | | |
354 | | - | |
355 | 333 | | |
356 | 334 | | |
357 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
358 | 342 | | |
359 | 343 | | |
360 | | - | |
| 344 | + | |
361 | 345 | | |
362 | 346 | | |
363 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 26 | | |
42 | 27 | | |
43 | 28 | | |
| |||
59 | 44 | | |
60 | 45 | | |
61 | 46 | | |
62 | | - | |
63 | 47 | | |
64 | 48 | | |
65 | | - | |
66 | 49 | | |
67 | 50 | | |
68 | 51 | | |
| |||
71 | 54 | | |
72 | 55 | | |
73 | 56 | | |
74 | | - | |
75 | | - | |
76 | 57 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
98 | 62 | | |
99 | 63 | | |
100 | 64 | | |
| |||
145 | 109 | | |
146 | 110 | | |
147 | 111 | | |
148 | | - | |
149 | 112 | | |
150 | 113 | | |
0 commit comments