improvement(mcp): bound pool create-invalidation + document DCR match#5777
Conversation
…; document DCR match
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview MCP OAuth start adds a comment on Reviewed by Cursor Bugbot for commit 009ef06. Configure here. |
Greptile SummaryThis PR bounds MCP connection-create invalidation state and documents the dynamic-registration error match. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "improvement(mcp): bound pool create-inva..." | Re-trigger Greptile |
Summary
Two follow-ups to the MCP connection pool (#5760) flagged in review:
serverGenerationscounterMap(grew one entry per distinct evicted server, forever) with a per-in-flight-create invalidation flag that lives inpendingand is cleared infinally— naturally bounded, no unbounded growth, and noserverGenerations.clear()needed on dispose.evictServernow flags matching in-flight creates directly instead of bumping a counter they re-read.serverGenerations.delete()after retirement) was unsafe — it reintroduced the evict-mid-create race the counter guarded (get() ?? 0returns 0 after delete, colliding with a fresh create's captured 0). The flag design removes that bug class entirely.Error(no typed class/code) when an auth server lacks aregistration_endpoint, so string-matching is the only available signal. Added a comment pinning it to@modelcontextprotocol/sdkv1.29.0registerClientso a version bump that rephrases the message is easy to spot.Type of Change
Testing
pending.setruns synchronously before the create's post-await check, and bothevictServerand the create's post-await section are await-free, so an eviction racing a create always sees the recordChecklist