perf(agentgateway): parallelize LoB MCP tool listing across fragments - #322
Open
wangzhengzhuo05 wants to merge 1 commit into
Open
perf(agentgateway): parallelize LoB MCP tool listing across fragments#322wangzhengzhuo05 wants to merge 1 commit into
wangzhengzhuo05 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #301
What / Why
get_mcp_tools_lobfetched MCP tools from destination fragments sequentially — N fragments × ~3s network round-trip each. Concurrent fetching makes total time ~max(fragment time) instead of the sum (e.g. 14 fragments ≈ 3s instead of ≈44s).How
for fragment ... await list_server_toolsloop withasyncio.gather(*coros, return_exceptions=True).return_exceptions=True+_log_mcp_server_error— same continuation semantics as before.Tests
test_lists_fragments_concurrently: 3 fragments × 0.05s sleeps complete in < 2× per-call (sequential would be 3×). Mutation check: reverting to a sequential loop makes this test fail (verified).test_failure_in_one_fragment_does_not_fail_others: 2nd fragment raises; other fragments' tools still returned.test_preserves_fragment_order: completion order is inverted via varied latencies; returned tools still follow fragment order.Local: 168 passed (test_lob + test_agw_client + test_customer).
AI-generated code disclosure
This change was implemented with the assistance of AI (OpenCode + muse-spark) and reviewed by a human maintainer process; per SAP GenAI guidelines the code has been verified for correctness, security, and license compatibility.