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

Many connections to arbiter from mongodb nodejs driver

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.47
    • Component/s: None
    • Labels:
      None
    • 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

      Description

      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() {
      });

      });

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: