{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-deadlock-when-an-mcp-server-s-sse-backpressure-signal-is-silently-absorbed-by-the-transport-layer-instead-of-propagating-to-the-m",
  "title": "Why does an instance deadlock when an MCP server's SSE backpressure signal is silently absorbed by the transport layer instead of propagating to the model's token loop",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP (Model Context Protocol) clients consuming server-streamed responses (SSE / chunked JSON-RPC notifications) where the server emits a flow-control signal (`notifications/message` progress updates, chunked `resources/read` streams, or partial `tools/call` results) and the client's transport buffers rather than blocks. Does not apply to unary request/response MCP calls or to transports with native OS-level backpressure (raw TCP without userland buffering).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-deadlock-when-an-mcp-server-s-sse-backpressure-signal-is-silently-absorbed-by-the-transport-layer-instead-of-propagating-to-the-m.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-deadlock-when-an-mcp-server-s-sse-backpressure-signal-is-silently-absorbed-by-the-transport-layer-instead-of-propagating-to-the-m.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-deadlock-when-an-mcp-server-s-sse-backpressure-signal-is-silently-absorbed-by-the-transport-layer-instead-of-propagating-to-the-m.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2212,
    "python_slice_tokens": 425,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the server is slow\" and not \"the client timed out.\" It is a **semantic mismatch between two backpressure regimes**: the server believes it is applying flow control by *not emitting* further chunks until it observes a drain acknowledgement, while the client's transport layer (HTTP/2 flow-control windows, an async iterator over a socket, a ...",
    "what_was_observed": "A tool server streaming a large `tools/call` result (a 40 MB structured log dump, emitted as ~2,000 SSE `message` events with `progress` notifications interleaved) was paired with a client whose SSE reader wrapped `httpx.AsyncClient.stream()`. The trace: 1. Server emits events 1–500. Client reads all 500 into an internal `asyncio.Queue` (unbounded, default). 2. Server's own write buffer fills at the OS socket layer; ...",
    "condition_of_validity": "This failure requires the conjunction of four conditions. Remove any one and the deadlock does not form: - **C1 — Unbounded client-side buffering.** The transport reads eagerly into a queue/stream with no high-water mark that propagates back to the consumer. (A bounded queue that blocks the reader would instead propagate backpressure correctly, at the cost o...",
    "decision_boundary": "The boundary is between **transport-level backpressure** (bytes in flight, socket buffers, HTTP/2 windows) and **application-level backpressure** (events the model loop has not yet consumed). Correct MCP streaming requires the two to be *coupled*: the application must not accept more events than it can process, and the transport must not read more bytes than...",
    "operational_effect": "Downstream consequences observed across three fleet incidents matching this signature: - **Silent hangs, not crashes.** No exception, no stack trace, no error log. The instance is a zombie: alive, connected, consuming zero CPU, producing zero output. Standard health checks (process alive, port open) pass. - **Timeout guard erosion.** Because progress notific..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK",
    "HTTP_429_BURST_STARVATION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "d4de718cc7654ee33ff6c58a01fd89e3bdd1c32caffd641a0f8b9abff683c0d2",
    "verified_classes": [
      "BackpressureBlindSpotError",
      "StreamedMCPResponse"
    ],
    "verified_functions": [
      "consume_with_flow_control",
      "main",
      "on_frame_received",
      "on_consumer_drain",
      "check_liveness_guard"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "BackpressureBlindSpotError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "asyncio",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
