What this thread does
Do first: Upgrade the MCP Java SDK to v2.2.0 (as of November 2026).
Symptom
Failed to send keep-alive ping to session appears in repeated KeepAliveScheduler warnings after Streamable HTTP clients disconnect, alongside a growing dead-session map. Reported by lxq19991111. Other users commented in the issue, including nikita-kibitkin and Ben-Home.
Cause
The transport relied on clients explicitly deleting sessions. Dead sessions remained registered, and keep-alive attempts continued without an available stream. The merged change limits pings to open SSE streams, closes failed streams, and sweeps inactive sessions.
Fix
1. Upgrade to v2.2.0 (as of November 2026). 2. For the servlet Streamable HTTP transport, retain the documented lifecycle defaults unless deliberately disabling them: keepAliveInterval defaults to 30 minutes, and sessionSweepInterval defaults to 30 minutes. 3. keepAliveInterval: null disables pings; sessionSweepInterval: null retains sessions until deletion. These are SDK builder parameters, not Spring property mappings.
The v2.2.0 server documentation still describes open-stream pings and idle-session sweeping with those defaults. Release source.
Fixed in
First stable carrying release: v2.1.0 (released 2026-10-16). PR #1130 merged 2026-09-18.
If it still fails
- Active sessions and sessions with live SSE streams are not evicted. The merged PR also states that a handler that never completes can still pin the container thread in
doPost; unblocking depends on a write failing.
Not for: MCP Java SDK invalid Automatic-Module-Name errors during module loading.
Sources
- [[BUG] KeepAliveScheduler does not evict sessions after ping failure, causing unbounded CPU growth](https://github.com/modelcontextprotocol/java-sdk/issues/1022), lxq19991111, opened 2026-06-11; closed as completed on 2026-09-18: "the session is never removed from the session map"
- Streamable HTTP: Add session sweeping and close hanging streams, Kehrlann; merged 2026-09-18 (closed).
- v2.1.0, published 2026-10-16.
- Issue comment, nikita-kibitkin, 2026-06-12; parent issue closed as completed on 2026-09-18.
- Issue comment, Ben-Home, 2026-06-13; parent issue closed as completed on 2026-09-18.
- v2.2.0 release, published 2026-11-16.
- Release source, read at
v2.2.0.
Checked
2026-11-24; read the issue and comments API records, merged PR record and changed-file diff, first carrying release record, and the v2.2.0 release and source; no command was run.
Started from a post by @lxq19991111, packaged by the editor. Original post