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

Trying to check in a connection which is not currently checked out by this pool

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.9.0, 2.10.0
    • Component/s: Connections
    • Labels:
      None
    • Environment:
      JRuby 9.2.7
      Rails 5.2.3
      Mongoid 7.0.4

      I am experiencing the following since upgrade to 2.9.0:

       

      vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0lib/mongo/server/connection_pool.rb:322:in `block in check_in': Trying to check in a connection which is not currently checked out by this pool: #<Mongo::Server::Connection:0x722dc377> (ArgumentError)
          from org/jruby/ext/thread/Mutex.java:165:in `synchronize'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/server/connection_pool.rb:320:in `check_in'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/server/connection_pool.rb:468:in `with_connection'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/server.rb:343:in `with_connection'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/operation/shared/executable.rb:41:in `dispatch_message'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/operation/shared/executable.rb:36:in `get_result'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/operation/shared/executable.rb:24:in `execute'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/operation/shared/executable_transaction_label.rb:27:in `execute'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/operation/shared/op_msg_or_find_command.rb:28:in `execute'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/collection/view/iterable.rb:89:in `send_initial_query'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/collection/view/iterable.rb:46:in `block in each'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/retryable.rb:61:in `block in read_with_retry_cursor'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/retryable.rb:250:in `legacy_read_with_retry'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/retryable.rb:119:in `read_with_retry'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/retryable.rb:60:in `read_with_retry_cursor'
          from vendor/bundle/jruby/2.5.0/gems/mongo-2.9.0/lib/mongo/collection/view/iterable.rb:45:in `each'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/query_cache.rb:227:in `each'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/contextual/mongo.rb:133:in `each'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/contextual.rb:20:in `each'
          from org/jruby/RubyEnumerable.java:461:in `to_a'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/criteria/findable.rb:108:in `from_database'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/criteria/findable.rb:76:in `multiple_from_db'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/criteria/findable.rb:20:in `execute_or_raise'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/criteria/findable.rb:41:in `find'
          from vendor/bundle/jruby/2.5.0/gems/mongoid-7.0.4/lib/mongoid/findable.rb:94:in `find'
          from lib/authentication/legacy_token_strategy.rb:34:in `legacy_session'
      
      

       

       

      The application's code fragment looks like

      Session.find(token).uid
      

       

       

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            alaz Alexander Azarov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: