Commit c67d95b
committed
xds: Implement Context propagation in ExternalProcessorClientInterceptor
Ensure request-scoped io.grpc.Context is correctly captured and propagated
across asynchronous thread boundaries during the external processor client-side
interceptor lifecycle.
Previously, asynchronous boundaries—including delayed application call
activation and downstream listener callbacks—ran on transport executor
threads without the request-scoped context, leading to lost telemetry, tracing,
and deadline propagation.
This change:
- Captures the active context as 'callContext' inside DataPlaneClientCall.start(),
representing the exact point when the application starts the RPC.
- Wraps delayed call activation execution in 'callContext.run(...)' to ensure
that downstream transport activation runs under the captured context.
- Refactors DataPlaneListener callback invocations to wrap downstream delegate
calls (onHeaders, onMessage, onClose, onReady) in 'callContext.run(...)'.
- Relies on implicit context propagation during stub.process() stream
initiation on the calling application thread.
- Adds Category 19 unit tests verifying context propagation to startCall,
listener callbacks, and the outbound ext_proc stream stub.
- Fixes checkstyle style compliance in main and test source classes.1 parent 32532c2 commit c67d95b
2 files changed
Lines changed: 323 additions & 8 deletions
File tree
- xds/src
- main/java/io/grpc/xds
- test/java/io/grpc/xds
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| 438 | + | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
| |||
526 | 528 | | |
527 | 529 | | |
528 | 530 | | |
529 | | - | |
| 531 | + | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
| |||
611 | 613 | | |
612 | 614 | | |
613 | 615 | | |
| 616 | + | |
614 | 617 | | |
615 | 618 | | |
616 | 619 | | |
| |||
1204 | 1207 | | |
1205 | 1208 | | |
1206 | 1209 | | |
1207 | | - | |
| 1210 | + | |
1208 | 1211 | | |
1209 | 1212 | | |
1210 | 1213 | | |
| |||
1216 | 1219 | | |
1217 | 1220 | | |
1218 | 1221 | | |
1219 | | - | |
| 1222 | + | |
1220 | 1223 | | |
1221 | 1224 | | |
1222 | 1225 | | |
| |||
1225 | 1228 | | |
1226 | 1229 | | |
1227 | 1230 | | |
1228 | | - | |
| 1231 | + | |
| 1232 | + | |
1229 | 1233 | | |
1230 | 1234 | | |
1231 | 1235 | | |
| |||
1275 | 1279 | | |
1276 | 1280 | | |
1277 | 1281 | | |
1278 | | - | |
| 1282 | + | |
1279 | 1283 | | |
1280 | 1284 | | |
1281 | 1285 | | |
| |||
1299 | 1303 | | |
1300 | 1304 | | |
1301 | 1305 | | |
1302 | | - | |
| 1306 | + | |
1303 | 1307 | | |
1304 | 1308 | | |
1305 | 1309 | | |
| |||
1318 | 1322 | | |
1319 | 1323 | | |
1320 | 1324 | | |
1321 | | - | |
| 1325 | + | |
1322 | 1326 | | |
1323 | 1327 | | |
1324 | 1328 | | |
1325 | | - | |
| 1329 | + | |
| 1330 | + | |
1326 | 1331 | | |
1327 | 1332 | | |
1328 | 1333 | | |
| |||
0 commit comments