From 70b1cc0821787fcd7e0ba8a5f4ebc6ec98ff67b3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 11 May 2026 23:40:23 +0000 Subject: [PATCH] chore(mcp): trim verbose comment on lock cleanup Co-authored-by: Mateo Wang --- litellm/proxy/_experimental/mcp_server/server.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/litellm/proxy/_experimental/mcp_server/server.py b/litellm/proxy/_experimental/mcp_server/server.py index 873a61a0127..bf2e1298091 100644 --- a/litellm/proxy/_experimental/mcp_server/server.py +++ b/litellm/proxy/_experimental/mcp_server/server.py @@ -3194,13 +3194,8 @@ if MCP_AVAILABLE: time.monotonic() ) - # Defensive cleanup: if the session has no auth-context - # tracking and no in-flight requests, the per-session lock - # would otherwise be orphaned (the periodic cleanup loop - # iterates ``_stateful_session_auth_context_last_seen`` and - # would never see it). This guards against narrow paths - # where a lock is created for a session_id that never - # entered ``_stateful_session_auth_contexts``. + # Periodic cleanup iterates _stateful_session_auth_context_last_seen, + # so locks for untracked sessions must be dropped here. if ( active_request_count <= 0 and session_id not in _stateful_session_auth_contexts