Skip to content
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

[mongo] don't throw on initial hosts connections #554

Open
marcj opened this issue Feb 14, 2024 · 0 comments
Open

[mongo] don't throw on initial hosts connections #554

marcj opened this issue Feb 14, 2024 · 0 comments

Comments

@marcj
Copy link
Member

marcj commented Feb 14, 2024

When multiple hosts are configured, currently it throws if only one is not available. This is wrong. It should only throw network related errors when all return an error and not a single needed host is available.

c5eda3d50b35f2b8ab5e868861dc/packages/mongo/src/client/connection.ts#L77

waitForAllConnectionsToConnect should not throw but just returns all catched errors.

ensureHostsConnected should only throw when throw=true and all hosts are down.

getConnection => ensureHostsConnected should catch the errors and throw only when no valid connection for the request can be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant