-
Notifications
You must be signed in to change notification settings - Fork 80
fix: atlas connection keeps reconnecting #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents the client from repeatedly disconnecting when the Atlas cluster status is unknown
, which was causing a reconnect loop.
- Group the
unknown
state withconnecting
so it no longer falls through to the default disconnect logic - Removed the standalone
case "unknown":
under the disconnect branch - No tests were added to verify the new handling of
unknown
status
Comments suppressed due to low confidence (1)
src/tools/atlas/connect/connectCluster.ts:214
- Add or update unit tests to cover the 'connecting' and 'unknown' cases to ensure the client does not reconnect unexpectedly and to prevent regressions.
case "connecting":
@@ -211,12 +211,12 @@ export class ConnectClusterTool extends AtlasToolBase { | |||
], | |||
}; | |||
} | |||
case "connecting": { | |||
case "connecting": | |||
case "unknown": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider logging when the status is 'unknown' so that developers can trace when and why the cluster enters this state, instead of silently ignoring it.
case "unknown": { | |
case "unknown": { | |
logger.warn( | |
LogId.atlasUnknownState, | |
"atlas-connect-cluster", | |
`Cluster "${clusterName}" in project "${projectId}" entered an unknown state.` | |
); |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need, this is just a missed db ping
Pull Request Test Coverage Report for Build 16294515117Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Proposed changes
Fix atlas connection keeps reconnecting
Checklist