Repository navigation
Database: a query reconnects after a failed connect, so a thawed instance stops answering "Topology is closed" - #124
Merged
Conversation
…ance stops answering "Topology is closed"
On Vercel an instance frozen mid-connect thawed to a closed topology, and the retry timer that was meant to fix it
was frozen too: /inbox and /oauth/consent returned 500 ("Failed to get session") until the timer fired. Now a closed
topology is dropped and the next query connects again inside its own request.
Browser error tracking also stops sending "Script error.", which an in-app browser's or extension's script raises with
no message or stack.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7
Signed-off-by: NiallJoeMaher <nialljoemaher@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PostHog error tracking showed 19 server errors, all
Failed to get session. Vercel's logs trace both 500s of the last two days (/inbox,/oauth/consent) toMongoTopologyClosedError: Topology is closed. One log line shows a connect that "timed out after 293681ms", which only happens when an instance is frozen mid-connect.The driver keeps a topology that closed after a failed connect, and auto-connect only connects when there is no topology.
keepConnectedretried on a timer, but the timer froze along with the instance, so the first request after a thaw failed.reconnectWhenCloseddrops a closed topology instead, and the next query connects again inside its own request. The test reproduces the prod error against the old client and passes against the new one.Browser error tracking also drops
Script error.: an in-app browser or extension raises it from another origin's script, with no message or stack.Checks (Node 22): typecheck, lint, 501 unit tests, 56 e2e.
pnpm designnot run: no UI changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7