Repository navigation
Conversation
for...in on a Map enumerates own enumerable properties of the object (none), so the SIGINT shutdown loop never ran and active session transports were never closed. Switched to for...of and reused the destructured transport instead of re-fetching it.
|
Thank you for this pull request, and apologies for the long wait for a response. Since it was opened, the reference servers have been rebuilt for the 2026-07-28 MCP specification (#4857) and released as v2 (2.0.0 on npm for the TypeScript servers, 2026.10.19 on PyPI for the Python servers). The code this PR changes has been replaced, and the behavior it addresses has either been fixed in v2 or no longer exists in the same form. This is not a judgment on the change or on you; it's a consequence of the code it targets having been replaced. If the problem still happens on v2, please open a fresh issue with the version you're running and steps to reproduce. Note that this repository now accepts contributions as issues rather than pull requests from anyone but its maintainers; see This is part of the backlog triage in #4875. |
Summary
The SIGINT handler in
src/everything/transports/streamableHttp.tsiterated thetransportsMap<string, StreamableHTTPServerTransport>withfor (const sessionId in transports).for...inenumerates own enumerable properties of the object — aMaphas none — so the shutdown loop never executed: active sessions were never closed on Ctrl-C and the "Closing transport for session …" log never appeared.Switched to
for (const [sessionId, transport] of transports), reusing the destructured transport instead of re-fetching it from the Map. Introduced in refactor commit 5de886c; still present at tip.Testing
Static-analysis provable (
for...inover aMapyields no entries). Manual repro: startnpx server-everything streamableHttp, connect a client, send SIGINT — before the fix no close logs appear; after the fix each session transport closes.