Skip to content

Add connection retry logic for dead downstream servers#16

Merged
rockfordlhotka merged 1 commit into
mainfrom
feature/connection-retry
Feb 17, 2026
Merged

Add connection retry logic for dead downstream servers#16
rockfordlhotka merged 1 commit into
mainfrom
feature/connection-retry

Conversation

@rockfordlhotka

Copy link
Copy Markdown
Member

Summary

  • Adds ExecuteWithRetryAsync<T> to ConnectionManager that wraps client operations with automatic reconnection on transport failures
  • On IOException, HttpRequestException, SocketException, or ObjectDisposedException, the dead connection is disconnected and retried once with a fresh connection
  • Business-logic errors (AggregatorException, OperationCanceledException) propagate immediately without retry
  • All call sites updated: ToolIndex, ToolProxyHandler, AdminTools, AdminController

Test plan

  • 13 new unit tests covering ShouldRetry for all exception types (retryable, non-retryable, wrapped inner exceptions)
  • All 66 tests pass
  • Manual: register a stdio server, kill it, verify aggregator reconnects on next request

🤖 Generated with Claude Code

When a downstream MCP server crashes, the aggregator now automatically
disconnects the stale connection and retries once with a fresh connection
instead of permanently caching the dead client.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rockfordlhotka
rockfordlhotka merged commit 757e5c4 into main Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant