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

connect_nonblock failing with Errno::EINVAL on Windows 2003 R2 x64 SP2

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.6.3
    • Affects Version/s: 1.6.2
    • Component/s: None
    • Environment:
      Windows Server 2003 R2
      Standard x64 Edition
      Service Pack 2

      MRI ruby 1.9.2-p125

      The exception "Invalid argument - connect(2)" of class Errno::EINVAL is being raised by the following code:

      Mongoid.load!(Dir.pwd + '/config/mongoid.yaml')
      Mongoid.configure do |config|
      config.master = Mongo::Connection.new(Config.instance.global['CN'], 27017, pool_size: 50, pool_timeout: 15).db('test')
      end

      The code snippet above is in the file db_layer:81, from there the exception goes into the mongo driver.
      The exception is thrown randomly by a connect_nonblock in the driver (lib/mongo/util/tcp_socket.rb:52).

      Switching back to mongo 1.6.1 fixes the problem.

      Backtrace:
      "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/util/tcp_socket.rb:52:in `connect_nonblock'", "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/util/tcp_socket.rb:52:in `connect'", "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/util/tcp_socket.rb:22:in `initialize'",
      "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/connection.rb:630:in `new'", "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/connection.rb:630:in `check_is_master'", "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/connection.rb:404:in `connect'", "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/connection.rb:594:in `setup'", "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongo-1.6.2/lib/mongo/connection.rb:114:in `initialize'", "C:/RCS/DB/lib/test-db/db_layer.rb:81:in `new'",
      "C:/RCS/DB/lib/test-db/db_layer.rb:81:in `block in connect'",
      "C:/RCS/Ruby/lib/ruby/gems/1.9.1/gems/mongoid-2.4.8/lib/mongoid.rb:116:in `configure'",
      "C:/RCS/DB/lib/test-db/db_layer.rb:80:in `connect'",
      "C:/RCS/DB/lib/test-db/manager.rb:34:in `run'",
      "C:/RCS/DB/lib/test-db/manager.rb:122:in `run!'",
      "bin/test:10:in `<main>'"

            Assignee:
            tyler@10gen.com Tyler Brock
            Reporter:
            d.milan Daniele Milan
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: