Commit b6647b1
committed
fix(provisioning,server): exit retry loop on Accepted outcome; await runtime in foreground mode
Two live-AWS regressions, both rooted in earlier work on this branch.
Provisioning retry loop spawned redundant fleets for async providers.
Async providers (EC2Fleet/SpotFleet REQUEST/MAINTAIN) return an
Accepted outcome with zero instances on the first call — fulfilment
finishes out of band and the status poller reconciles it. The retry
loop interpreted "0 fulfilled + not final" as "retry with a new
batch", so each accepted request grew a second and third fleet on the
side. Polling later saw one healthy fleet and N-1 empty fleets and
flipped the request to complete_with_error. Break out of the loop as
soon as an Accepted outcome lands so the single accepted fleet drives
the rest. No in-tree provider emits RequiresFollowUp today; if one
does later, persist_acquiring becomes reachable again.
Foreground server start re-entered asyncio.run inside the CLI's own
asyncio.run(main()). daemon_mod.start called _spawn_runtime which
called asyncio.run, raising RuntimeError "asyncio.run cannot be
called from a running event loop". The exception was caught and
returned exit_code=1, so the subprocess died silently inside 30s and
every rest_api live test hit the "ORB server failed to start" timeout.
handle_server_start now drives the pid + token lifecycle directly in
foreground mode and awaits the runtime coroutine in the existing
event loop.
The retry-loop persist_acquiring tests guarded a write that only ran
between retry attempts. With Accepted no longer triggering a retry,
the persist path is unreachable; the post-call
update_request_from_provisioning in request_creation_handlers already
stamps IN_PROGRESS (or PARTIAL / FAILED) once the orchestrator
returns. Replaced with a test that verifies the Accepted outcome
exits the loop after exactly one provider call.1 parent 4ab16a7 commit b6647b1
4 files changed
Lines changed: 99 additions & 117 deletions
File tree
- src/orb
- application/services
- interface
- tests/unit
- application/services
- interface
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | 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 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
150 | 180 | | |
151 | 181 | | |
152 | 182 | | |
| |||
Lines changed: 30 additions & 109 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
| 207 | + | |
| 208 | + | |
209 | 209 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
246 | 213 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
282 | 221 | | |
283 | 222 | | |
284 | | - | |
285 | | - | |
| 223 | + | |
| 224 | + | |
286 | 225 | | |
287 | 226 | | |
288 | 227 | | |
289 | 228 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 229 | + | |
300 | 230 | | |
301 | | - | |
302 | | - | |
303 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
304 | 234 | | |
| 235 | + | |
305 | 236 | | |
306 | 237 | | |
307 | 238 | | |
308 | | - | |
| 239 | + | |
309 | 240 | | |
310 | 241 | | |
311 | 242 | | |
312 | 243 | | |
313 | 244 | | |
314 | 245 | | |
315 | 246 | | |
316 | | - | |
| 247 | + | |
317 | 248 | | |
318 | 249 | | |
319 | 250 | | |
320 | 251 | | |
321 | 252 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
336 | 256 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
103 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 | | |
105 | | - | |
| 115 | + | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
109 | | - | |
| 119 | + | |
| 120 | + | |
110 | 121 | | |
111 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
118 | 140 | | |
119 | 141 | | |
120 | 142 | | |
| |||
0 commit comments