-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Make connection errors catchable #400
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes our database server restarts, which causes all clients using get disconnected. We have a whole bunch of servers which all talk to the same database, so I have to manually restart all of these to get them to reconnect again.
Making a
MongoClient
automatically reconnect closed connections would be nice, but would probably require a lot of work and might be out of scope for this project.Instead, I'm fine with handling this myself, but the problem is that may calls result in an unhandled rejection being thrown that you can't easily catch.
Specifically
Protocol.ts receive()
seems to be generating a bunch of unhandled rejections. Sometimes I'm getting "Invalid response header". Other timesthis.#reader.readFull
rejects with "Connection reset by peer".I can reliably reproduce this by simply restarting mongod:
brew services restart mongodb-community
The text was updated successfully, but these errors were encountered: