Commit d9085c0
Fix nested object fetching and exception handling in
Updates `FieldResolver` to return `Value<Unit>` from `fetchObject`, `fetchObjectSerially`, and `resolveField` instead of returning `Unit` or `Value<FieldResolutionResult>`. This ensures that the execution chain properly waits for all nested object and list fetching to complete before considering the parent operation finished.
Refines exception handling in `FieldResolver` to ensure proper error bubbling:
- `fetchObject` and `fetchObjectSerially` now allow fatal errors (those not swallowed by `executeField`) to bubble up by propagating exceptions caught in `recover`.
- `executeField` continues to encapsulate `FieldFetchingException` and `InternalEngineException` (returning success for partial results).
- `maybeFetchNestedObject` now waits for all list items to be fetched.
Also updates `IViaductInstrumentation` and related classes to change the `beginFetchObject` return type to `InstrumentationContext<Unit>` to match the new `fetchObject` signature.
Github-Change-Id: 967307
GitOrigin-RevId: acc8aca219f0052faf88908de65d2f66e3e09d60FieldResolver (AIRBNB)1 parent 50924f3 commit d9085c0
File tree
15 files changed
+467
-65
lines changed- engine
- api/src
- main/kotlin/viaduct/engine/api/instrumentation
- testFixtures/kotlin/viaduct/engine/api/mocks
- test/kotlin/viaduct/engine/api/instrumentation
- runtime/src
- main/kotlin/viaduct/engine/runtime
- execution
- instrumentation
- test/kotlin/viaduct/engine/runtime
- execution
- instrumentation
- tenant/runtime/src/integrationTest/kotlin/viaduct/tenant/runtime/featuretests
15 files changed
+467
-65
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
545 | | - | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
engine/api/src/test/kotlin/viaduct/engine/api/instrumentation/ViaductInstrumentationAdapterTest.kt
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
83 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
Lines changed: 52 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
94 | 103 | | |
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
100 | | - | |
| 109 | + | |
101 | 110 | | |
102 | 111 | | |
103 | 112 | | |
| |||
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
113 | | - | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | | - | |
| 125 | + | |
117 | 126 | | |
118 | 127 | | |
119 | 128 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
| |||
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
140 | 161 | | |
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
144 | 165 | | |
145 | 166 | | |
146 | | - | |
| 167 | + | |
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
| |||
156 | 177 | | |
157 | 178 | | |
158 | 179 | | |
159 | | - | |
160 | 180 | | |
161 | 181 | | |
162 | 182 | | |
163 | | - | |
| 183 | + | |
164 | 184 | | |
165 | 185 | | |
166 | 186 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 187 | + | |
174 | 188 | | |
175 | | - | |
176 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
177 | 195 | | |
178 | 196 | | |
179 | 197 | | |
| |||
196 | 214 | | |
197 | 215 | | |
198 | 216 | | |
199 | | - | |
| 217 | + | |
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
| |||
245 | 263 | | |
246 | 264 | | |
247 | 265 | | |
248 | | - | |
| 266 | + | |
249 | 267 | | |
250 | 268 | | |
251 | 269 | | |
| |||
303 | 321 | | |
304 | 322 | | |
305 | 323 | | |
306 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
307 | 327 | | |
| 328 | + | |
| 329 | + | |
308 | 330 | | |
309 | 331 | | |
310 | 332 | | |
| |||
321 | 343 | | |
322 | 344 | | |
323 | 345 | | |
324 | | - | |
325 | 346 | | |
326 | 347 | | |
327 | 348 | | |
| |||
497 | 518 | | |
498 | 519 | | |
499 | 520 | | |
| 521 | + | |
500 | 522 | | |
501 | 523 | | |
502 | 524 | | |
| |||
522 | 544 | | |
523 | 545 | | |
524 | 546 | | |
525 | | - | |
| 547 | + | |
526 | 548 | | |
527 | | - | |
528 | | - | |
| 549 | + | |
| 550 | + | |
529 | 551 | | |
530 | 552 | | |
531 | 553 | | |
532 | | - | |
| 554 | + | |
533 | 555 | | |
534 | 556 | | |
535 | 557 | | |
536 | 558 | | |
537 | 559 | | |
| 560 | + | |
538 | 561 | | |
| 562 | + | |
539 | 563 | | |
540 | 564 | | |
541 | | - | |
| 565 | + | |
542 | 566 | | |
543 | 567 | | |
544 | 568 | | |
| |||
0 commit comments