Repository navigation
perf(upstream): list tools from servers concurrently during discovery - #1814
Conversation
A discovery sweep listed each connected server's tools one after another, so one slow or large upstream delayed every other server's tools/list by up to its own timeout. The sweep now lists up to 8 servers at once (discoveryListConcurrency) and records the results in the same order and with the same logging as before. A server's concurrent tools/list calls were already coalesced into one request, and each capture carries its own sequence, so the order in which the lists finish does not affect how their results are applied.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Register 12 servers whose tools/list holds until 8 are in flight, then assert the peak never exceeds discoveryListConcurrency; removing the semaphore now fails. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks — clean change, cross-model review (gpt-6.1-sol) came back clean too. The one gap was that nothing asserted the upper bound (removing the semaphore left every test green), so I pushed |
|
Merged. Thank you, @poolski! Discovery sweeps used to wait on each upstream's Contributions like this are what keep MCPProxy moving, and they matter a lot to the project. One small ask, only if you feel like it: a short public note about your change (a tweet, a LinkedIn post, a line in a community you are part of) helps more people discover MCPProxy. No pressure at all, and I would be glad to repost it. |
A discovery sweep listed each connected server's tools one after another, so one slow or large upstream delayed every other server's
tools/listby up to its own timeout.The sweep now lists up to 8 servers at once (
discoveryListConcurrency). Results are recorded in the original order with the same logging,markSweptand capture handling. A server's concurrenttools/listcalls were already coalesced into one request, and each capture carries its own process-global sequence, so the order in which lists finish does not change how their results are applied.TestDiscoverToolsListsServersConcurrentlyuses three upstreams whosetools/listwaits for another list to be in flight and requires the sweep to overlap them.Testing
go test -race ./internal/upstream/...scripts/test-api-e2e.sh(70/70)golangci-lintwith.github/.golangci.yml, bare and--build-tags server: no new issues