You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wire Redis session storage and fix MultiSession lookup
Two bugs prevented Redis-backed VirtualMCPServer from working correctly
across pods:
1. The vmcp process never read the SessionStorage field from its config,
always using in-memory (local) storage regardless of operator config.
Fixed by adding SessionStorageConfig to server.Config and a
buildRedisConfig helper in commands.go that reads the provider,
address, DB, and password (via THV_SESSION_REDIS_PASSWORD) from the
vmcp config at startup.
2. With Redis-backed storage, sessionmanager.Manager.GetMultiSession()
always returned (nil, false) for fully-formed sessions. The
transportsession.Manager.Get() deserialises from Redis into a plain
*StreamableSession, losing the defaultMultiSession type. The type
assertion sess.(vmcpsession.MultiSession) therefore always failed,
causing GetAdaptedTools to error, which triggered the cleanup defer
to call Terminate(), marking the session terminated=true in Redis.
The client's next request got a 404 "session terminated".
Fixed by adding a node-local sync.Map (multiSessions) to
sessionmanager.Manager as the authoritative store for live
MultiSession objects. CreateSession stores the live session there
after UpsertSession succeeds; GetMultiSession and Terminate consult
the local map first before falling back to the pluggable backend.
Also adds:
- E2E test: VirtualMCPServer Redis Session Continuity — verifies that
MCP sessions survive complete pod replacement when Redis is configured
(ServiceAffinityNone, 2 replicas, all pods deleted and replaced).
- Redis image constant and DeployRedis/CleanupRedis helpers in the
e2e test package.
Related-to: #4220
0 commit comments