Skip to content

Document vMCP circuit breaker and failure handling - #536

Merged
yrobla merged 1 commit into
mainfrom
issue-535
Feb 10, 2026
Merged

yrobla merged 1 commit into
mainfrom
issue-535

Conversation

@yrobla

@yrobla yrobla commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Description

Add comprehensive documentation for Virtual MCP Server's circuit breaker and failure handling features, addressing the gap identified in issue #535.

The new failure-handling guide covers:

  • Circuit breaker states (Closed, Open, Half-open) with state diagram
  • Configuration options for circuit breaker and health checks
  • Partial failure modes (fail vs best_effort)
  • Production-ready example configurations
  • Troubleshooting common circuit breaker issues

This integrates with existing backend-discovery documentation which already covers health status monitoring and the /status endpoint, avoiding duplication while providing focused guidance on circuit breaker patterns for handling backend failures gracefully.

Type of change

  • New documentation

Related issues/PRs

Resolves: #535
Related: stacklok/toolhive#3036

Screenshots

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Navigation

  • New pages include a frontmatter section with title and description at a minimum
  • Sidebar navigation (sidebars.ts) updated for added, deleted, reordered, or renamed files
  • Redirects added to vercel.json for moved, renamed, or deleted pages (i.e., if the URL slug changed)

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Copilot AI review requested due to automatic review settings February 9, 2026 09:55
@vercel

vercel Bot commented Feb 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment Feb 9, 2026 0:09am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Virtual MCP Server (vMCP) guide focused on circuit breaker behavior and partial-failure handling, filling the documentation gap called out in issue #535 and linking back to existing backend status monitoring docs to avoid duplication.

Changes:

  • Adds a new Failure handling guide covering circuit breaker states/config, partial failure modes, examples, and troubleshooting.
  • Wires the new guide into the vMCP docs navigation sidebar.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
sidebars.ts Adds the new failure-handling guide to the “Guides: Virtual MCP Server” sidebar section.
docs/toolhive/guides-vmcp/failure-handling.mdx New end-to-end documentation for vMCP circuit breaker and partial-failure behavior, with configuration examples and troubleshooting.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Add comprehensive documentation for Virtual MCP Server's circuit breaker
and failure handling features, addressing the gap identified in issue #535.

The new failure-handling guide covers:
- Circuit breaker states (Closed, Open, Half-open) with state diagram
- Configuration options for circuit breaker and health checks
- Partial failure modes (fail vs best_effort)
- Production-ready example configurations
- Troubleshooting common circuit breaker issues

This integrates with existing backend-discovery documentation which
already covers health status monitoring and the /status endpoint,
avoiding duplication while providing focused guidance on circuit
breaker patterns for handling backend failures gracefully.

Resolves: #535
Related: stacklok/toolhive#3036

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@danbarr

danbarr commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Editorial Review: PR 536 - Failure Handling Documentation

Summary

This PR adds excellent documentation for circuit breaker and partial failure modes. The content is well-structured, follows Diataxis principles (clear how-to guide), and provides practical examples. Only minor improvements suggested below.


✅ Strengths

  • Excellent visual aid: The Mermaid state diagram (lines 55-63) clearly explains circuit breaker transitions
  • Proper structure: Conceptual overview before implementation details
  • Practical examples: The two configuration examples (lines 261-320) with inline rationale are very helpful
  • Good use of collapsible sections: Troubleshooting section (lines 322-410) appropriately uses details/summary
  • Clear distinction: Circuit breaker vs partial failure modes are well separated
  • Style guide compliance: Second person, active voice, sentence case headings ✓

📝 Suggestions for Improvement

1. Strengthen "when to use" guidance (lines 32-38)

Issue: The decision-making guidance is buried in a tip callout. This is important information that helps users decide whether to enable this feature.

Suggestion: Expand the Overview section to include a dedicated "When to enable circuit breaker" subsection:

## Overview

When backends fail due to crashes, network issues, or rate limiting, vMCP provides circuit breaker and partial failure modes to handle failures gracefully:

- **Circuit breaker**: Prevents cascading failures by immediately rejecting requests to failing backends instead of waiting for timeouts
- **Partial failure modes**: Choose whether to fail entire requests or continue with available backends
- **Automatic recovery**: Backends are automatically restored when they recover

### When to enable circuit breaker

Enable circuit breaker for:
- Production environments where backends may experience temporary failures (deployments, restarts, rate limits)
- Systems with multiple backend dependencies where cascading failures are a concern
- Environments where fast failure response is preferred over retry attempts

Health checks alone may be sufficient for:
- Highly stable backends with minimal downtime
- Development environments where debugging requires seeing actual failures
- Single-backend deployments where circuit breaker adds unnecessary complexity

2. Improve table formatting (lines 94-103)

Issue: The "Circuit breaker" row in the configuration table creates an awkward separator within the table.

Suggestion: Split into two subsections for better visual hierarchy:

### Health check configuration

| Field                     | Description                                           | Default |
| ------------------------- | ----------------------------------------------------- | ------- |
| `healthCheckInterval`     | Time between health checks for each backend           | `30s`   |
| `unhealthyThreshold`      | Consecutive failures before marking backend unhealthy | `3`     |
| `healthCheckTimeout`      | Maximum duration for a single health check            | `10s`   |
| `statusReportingInterval` | Interval for reporting status to Kubernetes           | `30s`   |

### Circuit breaker configuration

| Field               | Description                                   | Default |
| ------------------- | --------------------------------------------- | ------- |
| `enabled`           | Enable circuit breaker                        | `false` |
| `failureThreshold`  | Number of failures before opening the circuit | `5`     |
| `timeout`           | Duration to wait before testing recovery      | `60s`   |

3. Minor clarity improvements

Line 151: "any required backend is unavailable"

  • Clarify what makes a backend "required" or simply say "any backend"

Line 188: phase: Degraded # Ready|Degraded if some backends unhealthy

  • Consider rewording the comment to avoid pipe character: # Ready or Degraded if some backends unhealthy

Line 208: consecutiveFailures: 2 # Reduced after partial recovery

  • The concept of "partial recovery" isn't explained elsewhere. Consider simplifying to: # Failure count during recovery testing

4. Terminology consistency

Throughout: The doc uses "health status", "health state", and "backend status" interchangeably.

Recommendation:

  • Use "health status" when referring to the condition (healthy, degraded, etc.)
  • Use "backend status" when referring to the overall state including health plus metadata
  • Consider adding this to the project word list (CLAUDE.md)

🎯 Overall Assessment

This is high-quality documentation that meets the bar for merging. The suggested improvements are minor and could be addressed in a follow-up if needed. The content is clear, accurate, and provides exactly what operators need to configure failure handling effectively.

Recommendation: Approve with optional minor improvements

@yrobla
yrobla merged commit 2e1a9d6 into main Feb 10, 2026
10 checks passed
@yrobla
yrobla deleted the issue-535 branch February 10, 2026 09:13

This branch was successfully deployed

1 active deployment
Preview — d2beb94a Deployed Feb 9, 2026 by vercel[bot]
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.

[Gap]: Document vMCP circuit breaker

4 participants