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

connectTimeoutMS hardcoded to 30000 and not using any passed in settings when initiating connection

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0
    • Component/s: None
    • Labels:
    • Environment:
      Linux

      In mongo_client.js, line 212, it loops through the servers and sets up the socket options. According to the docs we are supposed to be able to customize these socket options, but in this case they are just flat out hardcoded. The result of this is when I boot up a connection, it will wait the full 30s to wait to connect to each replica member even if I only want it to wait say 500ms. I'm not intimately familiar with the code base, but shouldn't it merge in the results from object.rs_options or object.mongos_options and use those for initiating the connection to the servers?

      var _server_options = {
      poolSize:1
      , socketOptions:

      { connectTimeoutMS:30000 , socketTimeoutMS: 30000 }

      , auto_reconnect:false};

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            owenallenaz Owen Allen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: