-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.1.14
-
Component/s: None
-
Labels:
-
Environment:Driver version 2.1.14. Mongod version 3.0.x
-
Empty show more show less
We are finding that the number of connections to secondaries and arbiters will seemingly grow without bound over time, while the connections on the primary will stay relatively constant.
The code below should reproduce this issue:
var mongodb = require("mongodb"); var uri = "mongodb://admin:admin@localhost:27017,localhost:27018/admin"; var interval = 1000; var openThenClose = function(){ var MongoClient = mongodb.MongoClient; MongoClient.connect(uri, function(err, db) { console.log("open"); var descriptors = db.collection("some-collection").find(); descriptors.toArray(function(err, docs){ db.close(function(){ console.log("close"); }); }); }); }; setInterval(function(){ openThenClose(); }, interval);
Active connection counts are being gleaned from the mongod logs.