Open marcj opened 9 months ago
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.
waitForAllConnectionsToConnect
ensureHostsConnected should only throw when throw=true and all hosts are down.
ensureHostsConnected
throw=true
getConnection => ensureHostsConnected should catch the errors and throw only when no valid connection for the request can be found.
getConnection => ensureHostsConnected
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 whenthrow=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.