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

Many connections to arbiter from mongodb nodejs driver

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.47
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Debian Squeeze 64 bit
      mongoDB 3.0.6 replica set
       - primary
       - secondary
       - hidden secondary (votes: 0)
       - arbiter
      Node.js 4.1.2
      mongodb driver 2.0.45
      mongodb-core 1.2.14

      I tested mongodb nodejs driver with one simple query (find) and on every member (except hidden secondary with 0 TCP connections from Node.js) of replica set I saw same count of TCP connections in ESTABLISHED state (exactly 5). I understand why is it on primary and secondary, but why on arbiter?

      google group conversation about this theme: https://groups.google.com/forum/#!topic/mongodb-user/6TJznalji6k

      nodejs code (copy paste from mongodb driver docs) which I run in shell "node test.js":
      var findDocuments = function(db, callback) {
      // Get the documents collection
      var collection = db.collection('blah');
      // Find some documents
      collection.find({}).toArray(function(err, docs)

      { assert.equal(err, null); assert.equal(2, docs.length); console.log("Found the following records"); console.dir(docs) callback(docs); }

      );
      }

      var MongoClient = require('mongodb').MongoClient,
      f = require('util').format,
      assert = require('assert');

      // Connection URL
      var url = 'mongodb://user:password@server:27301/blah?replicaSet=replsetname';
      // Use connect method to connect to the Server
      MongoClient.connect(url, function(err, db) {
      assert.equal(null, err);
      console.log("Connected correctly to server");

      findDocuments(db, function() {
      });

      });

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            filip.havlicek@livesport.eu Filip HavlĂ­?ek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: