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

Mongo::Server::ConnectionPool#with_connection sometimes yield `nil`

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.4
    • Affects Version/s: 2.0.2, 2.0.3
    • Component/s: Connections
    • Labels:
      None

      We get an error when running either queries or inserts. The following error that occurs is `NoMethodError: undefined method `dispatch' for nil:NilClass` originating here https://github.com/mongodb/mongo-ruby-driver/blob/v2.0.3/lib/mongo/operation/executable.rb#L35

      This means that `nil` was yielded from `Mongo::Server::ConnectionPool#with_connection` which in turn must mean that `Mongo::Server::ConnectionPool::Queue#dequeue` can return `nil`.

      Looking at the code it doesn't seem like this can happen unless some non-thread safe stuff is going on.

      I will try different ruby versions, but at this point I cannot figure out what is causing this.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            terje Terje Larsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: