Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-687

Connections leaking on secondaries and arbiters

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.15
    • Affects Version/s: 2.1.14
    • Component/s: None
    • Labels:
    • Environment:
      Driver version 2.1.14. Mongod version 3.0.x

      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.

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            will@objectlabs.com Will Shulman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: