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

Cannot set socketTimeoutMS to 0 in MongoClient.connect

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.5
    • Affects Version/s: 2.2.4
    • Component/s: None
    • Labels:

      Setting socketTimeoutMS or connectTimeoutMS to 0 when calling MongoClient.connect(url, options, callback) results in a timeout value of 120000.

      This code in mongo_client.js does not correctly handle a setting of 0:

      // Check if we have connection and socket timeout set
      if(!_finalOptions.socketTimeoutMS) _finalOptions.socketTimeoutMS = 120000;
      if(!_finalOptions.connectTimeoutMS) _finalOptions.connectTimeoutMS = 120000;

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            stalar Staffan Larsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: