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

ReplSetConnection does not try further seed nodes if connection is established but seed node hangs

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.1
    • Affects Version/s: 1.8.0
    • Component/s: None
    • Labels:
      None
    • Fully Compatible

      The following is a bit of a corner case, but I think it's related to an issue we've seen in practice (if you e.g. have a mongod which is still bound to a port but not actually accept()ing connections). Steps to reproduce:

      • Run a netcat:
        $ nc -lk localhost 7000
      • Use that netcat as the first node in your replica set:
        >> m = Mongo::ReplSetConnection.new(['127.0.0.1', 7000], ['127.0.0.1', 6001])
      • This will hang forever.
      • That's fine; set a :connect_timeout. Still hangs forever because under the hood, it's doing a read from the netcat session to learn about the cluster config.
      • Set an :op_timeout. An exception is raised (in particular, the next seed node is not tried).

      Is there an option for this case I'm missing? It seems like it might be worth making :connect_timeout be applicable until the connection instantiation has completed.

            Assignee:
            brandon.black@10gen.com Brandon Black
            Reporter:
            gdb Greg Brockman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: