-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replica Set
-
None
I've just changed my app to use the ReplSetConnection vs the regular Connection, and I'm using a post 1.7.0 build (git master 9bc8495e2d4868be22e27c384a616f8bdec8d551).
I've noticed my log files are littered with the following, at seemingly random intervals:
[2012-10-30T03:51:42Z] ERROR – vines: Thread pool operation failed: undefined method `[]' for nil:NilClass
[2012-10-30T03:51:42Z] DEBUG – vines: /home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/util/node.rb:117:in `secondary?'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/util/pool.rb:93:in `matches_mode'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/util/pool_manager.rb:110:in `read_pool'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/repl_set_connection.rb:412:in `read_pool'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/repl_set_connection.rb:342:in `block in checkout_reader'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/repl_set_connection.rb:325:in `checkout'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/repl_set_connection.rb:341:in `checkout_reader'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/cursor.rb:552:in `checkout_socket_from_connection'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/cursor.rb:487:in `block in send_initial_query'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/util/logging.rb:32:in `instrument'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/cursor.rb:483:in `send_initial_query'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/cursor.rb:468:in `refresh'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/cursor.rb:129:in `next'
/home/ec2-user/.gem/ruby/1.9.1/bundler/gems/mongo-ruby-driver-804e605bf49f/lib/mongo/collection.rb:303:in `find_one'
My app is threaded (I'm using eventmachine and all mongo operations are wrapped in deferrables), so this stack trace leads to be believe there's a race condition causing @config to be nil when secondary? is called.
I can't reproduce this in my dev env, it only seems to happen under the load of production.
ReplSetConnection:
opts = {
:pool_timeout => 5,
:pool_size => 5,
:op_timeout => 10,
:ssl => false,
:connect => true,
:refresh_mode => :sync
}
Server: 2.0.7
Config:
{
"_id" : "rs0",
"version" : 121314,
"members" : [
,
,
,
{ "_id" : 10, "host" : "DDD:27017", "priority" : 0 } ]
}
Also, my RS requires auth, if that changes anything.