Commit 573599d
# What does this PR do?
This PR parallelizes router fan-out work to reduce latency when many
providers or vector stores are registered.
`InferenceRouter.health` and `VectorIORouter.health` now snapshot
provider implementations and run per-provider health checks concurrently
with `asyncio.gather`, while preserving timeout and error mapping to
`HealthResponse`.
`VectorIORouter.openai_list_vector_stores` now retrieves registered
vector stores concurrently and preserves existing sorting and pagination
behavior by filtering failed retrievals.
## Test Plan
```bash
uv run pytest tests/unit/core/routers/test_vector_io.py tests/unit/core/routers/test_inference_router.py -q
```
Output:
```
............ [100%]
============================= slowest 10 durations =============================
(10 durations < 0.005s hidden. Use -vv to show these durations.)
12 passed in 0.23s
```
<hr>This is an automatic backport of pull request #5802 done by
[Mergify](https://mergify.com).
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4d0c563 commit 573599d
2 files changed
Lines changed: 34 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
357 | 358 | | |
358 | | - | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
370 | 370 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
381 | | - | |
| 380 | + | |
| 381 | + | |
382 | 382 | | |
383 | | - | |
384 | | - | |
| 383 | + | |
385 | 384 | | |
386 | | - | |
387 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
| |||
667 | 669 | | |
668 | 670 | | |
669 | 671 | | |
670 | | - | |
671 | | - | |
672 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
673 | 676 | | |
674 | | - | |
675 | 677 | | |
676 | | - | |
677 | | - | |
678 | | - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
679 | 681 | | |
680 | | - | |
| 682 | + | |
681 | 683 | | |
682 | 684 | | |
683 | 685 | | |
684 | 686 | | |
685 | | - | |
| 687 | + | |
686 | 688 | | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
691 | 693 | | |
692 | 694 | | |
693 | 695 | | |
| |||
0 commit comments