-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
loadBalanced=true drops connection after a delay and never reconnects #15042
Milestone
Comments
pieromarini
changed the title
loadBalanced=true drops connection and never reconnects
loadBalanced=true drops connection after a delay and never reconnects
Nov 15, 2024
I managed to repro this locally using some setup modified from https://alexbevi.com/blog/2024/03/08/mongodb-and-load-balancer-support/. You are right @pieromarini that the issue seems to be tied to #14812. I'm investigating. docker-compose.yml:
haproxy.cfg:
init-replica-set.sh:
|
vkarpov15
added a commit
that referenced
this issue
Dec 12, 2024
fix(connection): remove heartbeat check in load balanced mode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Mongoose version
8.7.0
Node.js version
16.20.2
MongoDB server version
7.0
Typescript version (if applicable)
No response
Description
When trying to connect to a database using
loadBalanced=true
in the connection string, mongoose drops the connection after some time but never reconnects.This happens in all versions >=8.7.0
8.6.4 doesn't have this issue and it reconnect successfully after the delay.
Steps to Reproduce
Providing sample code in which we manually add a delay so the connection drops and we never reconnect to MongoDB.
Setting
heartbeatFrequencyMS
to a value higher that the delay makes the issue go away but I'm not sure if this would be a recommended workaround.Expected Behavior
Mongoose should reconnect to the MongoDB database and the query should work
The text was updated successfully, but these errors were encountered: