This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: envoy-http3-happy-eyeballs-v2-pool-boundary

Envoy HTTP/3 Happy Eyeballs v2 Dual-Stack Upstream Pool Guardrail

Enforces strict connection pool boundaries, bounded Happy Eyeballs v2 (RFC 8305) fallback timers, and isolated circuit breakers for Envoy upstream HTTP/3 (QUIC) and TCP/TLS dual-stack clusters. Eliminates tail latency spikes and worker thread starvation caused by silent UDP blackholing and unconstrained concurrent fallback racing.

Prohibited Anti-Pattern: Unbounded Dual-Stack Concurrent QUIC/TCP Upstream Probing Inducing Worker Thread Exhaustion

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Envoy HTTP/3 Happy Eyeballs v2 Dual-Stack Upstream Pool Guardrail - Enforces strict connection pool boundaries, bounded Happy Eyeballs v2 (RFC 8305) fallback timers, and isolated circuit breakers for Envoy upstream HTTP/3 (QUIC) and TCP/TLS dual-stack clusters. Eliminates tail latency spikes and worker thread starvation caused by silent UDP blackholing and unconstrained concurrent fallback racing.
globs: envoy/**/*.{yaml,yml,json}, mesh/**/*.{yaml,yml,json}, infra/k8s/**/*.{yaml,yml}, src/infra/envoy/**/*.{ts,js}
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/envoy-http3-happy-eyeballs-v2-pool-boundary"
---

# Envoy HTTP/3 Happy Eyeballs v2 Dual-Stack Upstream Pool Guardrail

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Unbounded Dual-Stack Concurrent QUIC/TCP Upstream Probing Inducing Worker Thread Exhaustion

## System Constraints
You are a Principal Software Architect enforcing production-grade resilience standards for Envoy HTTP/3 and Happy Eyeballs v2 (RFC 8305) upstream routing. Enforce deterministic upstream connection pool boundaries, dedicated alternate protocol cache stores, bounded DNS resolution fallback delays, and explicit circuit breaker ceilings across QUIC (UDP) and TCP/TLS dual-stack pools to eliminate connection thread starvation during path degradation.

## Strict Guidelines
- Engineers MUST ALWAYS configure `alternate_protocols_cache_options` with a bounded entry limit and dedicated key-value store when enabling upstream HTTP/3 auto-protocol selection.
- Engineers MUST configure `dns_resolution_delay` (standard 300ms) within Happy Eyeballs v2 dual-stack resolution to avoid premature TCP fallback storms while preventing QUIC blackhole latency.
- Engineers MUST NOT allow unbounded concurrency in dual-stack connection pools; `circuit_breakers` MUST specify separate thresholds for QUIC UDP datagram sockets and TCP fallback sockets.
- Services MUST explicitly set `dns_lookup_family: ALL_EXTERNAL` or `V4_PREFERRED` with synchronous Happy Eyeballs interleaving rather than relying on host OS default resolver serialization.
- Components NEVER permit raw socket fallback without transport-layer timeouts (`connect_timeout` <= 2s, `max_rx_datagram_size` configured) to avoid holding worker thread event loops open indefinitely.

## Bad vs Good Implementations
### Configuring Dual-Stack HTTP/3 Upstream Cluster with Happy Eyeballs v2

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Omits alternate_protocols_cache_options and explicit Happy Eyeballs fallback delay. A blackholed UDP path causes blocking latency spikes up to the 10s connect_timeout across all dual-stack targets, depleting Envoy worker thread connection slots and degrading TCP throughput.
```typescript
// Flawed: Unbounded fallback without protocol cache or Happy Eyeballs tuning
export const makeUpstreamCluster = (name: string, address: string) => ({
  name,
  connect_timeout: '10s',
  type: 'STRICT_DNS',
  dns_lookup_family: 'AUTO',
  // Missing alternate_protocols_cache triggers raw dual-dial storms
  typed_extension_protocol_options: {
    'envoy.extensions.upstreams.http.v3.HttpProtocolOptions': {
      '@type': 'type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions',
      auto_config: {}
    }
  },
  load_assignment: {
    cluster_name: name,
    endpoints: [{ lb_endpoints: [{ endpoint: { address: { socket_address: { address, port_value: 443 } } } }] }]
  }
});
```

#### Production Standard (Correct)
> **Standard**: Implements an RFC 8305 300ms DNS resolution fallback delay, isolates protocol caching via persistent alternate protocols storage, sets tight connection timeouts (1.5s), and enforces explicit circuit-breaker caps on parallel connections, preventing worker thread exhaustion on UDP blackholes.
```typescript
// Production-Ready: RFC 8305 Happy Eyeballs v2 dual-stack HTTP/3 boundary
export const makeUpstreamCluster = (name: string, address: string) => ({
  name,
  connect_timeout: '1.5s',
  type: 'LOGICAL_DNS',
  dns_lookup_family: 'ALL_EXTERNAL',
  dns_resolution_delay: '0.300s', // RFC 8305 Happy Eyeballs connection attempt delay
  typed_extension_protocol_options: {
    'envoy.extensions.upstreams.http.v3.HttpProtocolOptions': {
      '@type': 'type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions',
      auto_config: {
        http3_protocol_options: {},
        alternate_protocols_cache_options: {
          name: `${name}_alpn_cache`,
          max_entries: 4096,
          key_value_store_config: {
            config: {
              '@type': 'type.googleapis.com/envoy.extensions.key_value.file_based.v3.FileBasedKeyValueStoreConfig',
              filename: `/var/run/envoy/${name}_alt_cache.db`
            }
          }
        }
      }
    }
  },
  circuit_breakers: {
    thresholds: [{
      priority: 'DEFAULT',
      max_connections: 2048,
      max_pending_requests: 1024,
      max_requests: 8192,
      track_remaining: true
    }]
  },
  load_assignment: {
    cluster_name: name,
    endpoints: [{ lb_endpoints: [{ endpoint: { address: { socket_address: { address, port_value: 443 } } } }] }]
  }
});
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Envoy HTTP/3 Happy Eyeballs v2 Dual-Stack Upstream Pool Guardrail

Envoy HTTP/3 Happy Eyeballs v2 Dual-Stack Upstream Pool Guardrail defines an industrial-grade behavioral standard for devops engineering. Enforces strict connection pool boundaries, bounded Happy Eyeballs v2 (RFC 8305) fallback timers, and isolated circuit breakers for Envoy upstream HTTP/3 (QUIC) and TCP/TLS dual-stack clusters. Eliminates tail latency spikes and worker thread starvation caused by silent UDP blackholing and unconstrained concurrent fallback racing. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Unbounded Dual-Stack Concurrent QUIC/TCP Upstream Probing Inducing Worker Thread Exhaustion Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftUnbounded Dual-Stack Concurrent QUIC/TCP Upstream Probing Inducing Worker Thread ExhaustionCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS configure `alternate_protocols_cache_options` with a bounded entry limit and dedicated key-value store when enabling upstream HTTP/3 auto-protocol selection.

Engineers MUST ALWAYS configure `alternate_protocols_cache_options` with a bounded entry limit and dedicated key-value store when enabling upstream HTTP/3 auto-protocol selection.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST configure `dns_resolution_delay` (standard 300ms) within Happy Eyeballs v2 dual-stack resolution to avoid premature TCP fallback storms while preventing QUIC blackhole latency.

Engineers MUST configure `dns_resolution_delay` (standard 300ms) within Happy Eyeballs v2 dual-stack resolution to avoid premature TCP fallback storms while preventing QUIC blackhole latency.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Engineers MUST NOT allow unbounded concurrency in dual-stack connection pools

Engineers MUST NOT allow unbounded concurrency in dual-stack connection pools; `circuit_breakers` MUST specify separate thresholds for QUIC UDP datagram sockets and TCP fallback sockets.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Services MUST explicitly set `dns_lookup_family

Services MUST explicitly set `dns_lookup_family: ALL_EXTERNAL` or `V4_PREFERRED` with synchronous Happy Eyeballs interleaving rather than relying on host OS default resolver serialization.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Components NEVER permit raw socket fallback without transport-layer timeouts (`connect_timeout` <= 2s, `max_rx_datagram_size` configured) to avoid holding worker thread event loops open indefinitely.

Components NEVER permit raw socket fallback without transport-layer timeouts (`connect_timeout` <= 2s, `max_rx_datagram_size` configured) to avoid holding worker thread event loops open indefinitely.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Envoy HTTP/3 Happy Eyeballs v2 Dual-Stack Upstream Pool Guardrail critical for AI coding assistants?

Enforces strict connection pool boundaries, bounded Happy Eyeballs v2 (RFC 8305) fallback timers, and isolated circuit breakers for Envoy upstream HTTP/3 (QUIC) and TCP/TLS dual-stack clusters. Eliminates tail latency spikes and worker thread starvation caused by silent UDP blackholing and unconstrained concurrent fallback racing. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Unbounded Dual-Stack Concurrent QUIC/TCP Upstream Probing Inducing Worker Thread Exhaustion) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Envoy