-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.1.19
-
Component/s: None
-
Labels:
-
Environment:Ubuntu Server 14.04 LTS (HVM)
Node version 4.4.3
Driver version 2.1.18
Mongod version 3.0.x
-
Empty show more show less
We are finding that the number of connections to the Secondary 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.