Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1027

Client initialization with list of URLs (Regression?)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: 2.0.6
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None
    • Environment:
      Centos 6.6

      Description

      I've run into an issue specifying connection strings after our update from mongodb 2.6 to 3.0.

      Previously, using the Ruby driver I could use the following call scheme to connect to a cluster with urls:

      Mongo::Client.new(["one.com:10001", "two.com:20002"],

      {..option...}

      )

      When connecting to the new 3.x instance, once I execute a query (or list databases, etc..) this causes a full timeout loop followed by an error: Mongo::Error::NoServerAvailable: No server is available matching preferences

      With debug level logging on, I see lots of getaddrinfo errors while this is taking place: getaddrinfo: name or service not known

      Given that urls seem to now require a mongodb:// prefix when connecting to a single db, I also tried

      Mongo::Client.new(["mongodb://one.com:10001", "mongodb://two.com:20002"],

      {..options...})

      But that has the same result. The only way I could get it to work was with IPs, eg.

      Mongo::Client.new(["192.168.0.1:10001", "192.168.0.2:20002"], {..options...}

      )

      In my mind, either this change was intended, and entering non-IPs should generate some sort of useful error about bad arguments rather than producing a timeout later, or this is a regression from previous behavior.

        Attachments

          Activity

            People

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            mmcguinness@grasshopper.com Michael McGuinness
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: