-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.0.0
-
Component/s: Load Balancer
Node driver: 6.0 or above
NodeJs: V20 or above
OS: Windows 10
We have a self-managed mongodb cluster deployed in AKS container. The nodejs application connects to this mongo instance via a external IP provided by LoadBalancer service. The connection used to work very well when we used node driver 5.3 and nodejs 16.14. After we upgraded driver to 6.5 and nodejs to 20.11 connections in mongo connection pool were closed constantly after they were idle for around 4 minutes. I subscribed connectionClosedEvent to monitor mongo connection pool. I can see connectionClosedEvents constantly after connection pool was created soon. Along with these events were "read ECONNRESET" exceptions.
This issue only occurs when our nodejs application connects mongodb instance from windows. Connection from Linux is ok.
I know that LoadBalancer has 4 minutes idle time out. And after 4 minutes LoadBalancer will reset socket connections. This is probably the cause why connections were closed. But I think driver should send keepAlive packets to keep connections alive with interval shorter than 4 minutes. We didn't catch keepAlive packets.