fix(http): expire idle sessions so their relay sockets close #3
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/relay-socket-leak"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Production (2026-11-10) showed 397 ESTABLISHED sockets from the nope-mcp container to amb-relay.edufeed.org: every MCP session builds its own relay clients (own SimplePool,
src/session.ts) and is disposed only on DELETE or shutdown — edufeed-app's Termi opened one session per tool call and never sent DELETE.sessionIdleMs; an open SSE stream counts as in flight); an expired session id answers 404 so clients re-initialize.AMBRelayClient.close()usespool.destroy(), so relays removed via remove_relay close too.test/transport/sessionIdle.test.ts(undeleted session is disposed, then 404) and a real-WebSocket case intest/relay/realRelayTimeout.test.ts(0 sockets afterclose()); both fail without the fix.npm test1080 passed; build clean.edufeed-app is being changed to reuse one session per process (and to handle the 404 by re-initializing).
Squash-merge, please — then the homelab role re-run pulls
:main.