Connection leaking on Secondary server

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 2.1.19
    • Affects Version/s: 2.1.19
    • Component/s: None
    • Environment:
      Ubuntu Server 14.04 LTS (HVM)
      Node version 4.4.3
      Driver version 2.1.18

      Mongod version 3.0.x
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Christian Amor Kvalheim
            Reporter:
            Christopher Chang
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: