fix: return partial federation results on tools/list timeout - #112
Merged
Conversation
) Replace join_all + discard-all-on-timeout with a FuturesUnordered loop that collects results as upstreams respond. When the deadline fires, whatever arrived is merged and returned as a partial result instead of an error. Response includes "_arbitus_partial": true so callers can detect incomplete catalogs. Adds two new unit tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
tools/listacross multiple upstreams and the deadline fired, all results were discarded and a JSON-RPC error was returned — even if several upstreams had already replied.join_all+ timeout with aFuturesUnorderedloop (tokio::select!) that collects results as upstreams respond. When the deadline fires, whatever arrived is merged and returned."_arbitus_partial": truewhen not all upstreams replied, so clients can detect an incomplete catalog and retry or surface a warning.Closes #97
Test plan
cargo fmt --check— cleancargo clippy -- -D warnings— zero warningscargo test --lib— all 430 unit tests passfederated_tools_list_times_out_returns_empty_partial— all-hanging upstreams → empty tools list +_arbitus_partial: true, no errorfederated_tools_list_partial_results_on_timeout— one fast + one hanging → fast upstream's tools returned +_arbitus_partial: true🤖 Generated with Claude Code