Connection count not responding to maxIdleTimeMS #15362
Labels
help wanted
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Prerequisites
Mongoose version
8.13.2
Node.js version
18
MongoDB version
8.0.8
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
No response
Issue
I'm debugging an issue where my connection count increases over time like a memory leak. I'm using maxIdleTimeMS but after some testing it's not working the way I understand it should.
When I create a connection and run a query my connection count increases by a few (21 -> 26). Now, after maxIdleTimeMS has gone by, I continue to get the same count (26).
However, if I initiate another query on this connection, all of a sudden my connections drop (24). If I don't specify maxIdleTimeMS, the connection count remains the same (26).
At first I thought maybe I needed to adjust something like heartbeatFrequencyMS but that didn't change anything.
It looks like the "idle" connections aren't identifying themselves until a subsequent request is made to the database. Is this expected? Am I missing something? My issue is I need the connections to close automatically without subsequent requests.
The text was updated successfully, but these errors were encountered: