Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Fixed a typo in the query failure handler of Node #76

Merged
merged 1 commit into from
Sep 24, 2012

Conversation

mathieuravaux
Copy link
Contributor

This causes ArgumentError: wrong number of arguments(0 for 1) when a failover occurs

Sample backtrace (with Moped 1.2.2):

vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:343 • has_key?
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:343 • block in query
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:532 • []
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:532 • block (3 levels) in flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:531 • map
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:531 • block (2 levels) in flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:123 • ensure_connected
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:527 • block in flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:542 • logging
config/initializers/moped_newrelic_instrumentation.rb:48 • block in logging_with_newrelic
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2.1/lib/new_relic/agent/method_tracer.rb:242 • trace_execution_scoped
config/initializers/moped_newrelic_instrumentation.rb:45 • logging_with_newrelic
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:526 • flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:515 • process
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:341 • query
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cursor.rb:116 • block in load_docs
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/session/context.rb:109 • block in with_node
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cluster.rb:150 • block in with_primary
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:168 • ensure_primary
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cluster.rb:149 • with_primary
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/session/context.rb:108 • with_node
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cursor.rb:115 • load_docs
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cursor.rb:25 • each
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/query.rb:77 • each
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/query.rb:77 • each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:133 • block in each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:603 • selecting
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:132 • each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual.rb:18 • each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:619 • entries
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:619 • from_database
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:310 • multiple_from_map_or_db
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:176 • execute_or_raise
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:243 • find
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/finders.rb:61 • find
app/controllers/application_controller.rb:37 • current_user

This causes "ArgumentError: wrong number of arguments(0 for 1)" when a failover occurs

Sample backtrace (with Moped 1.2.2):
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:343 • has_key?
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:343 • block in query
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:532 • []
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:532 • block (3 levels) in flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:531 • map
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:531 • block (2 levels) in flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:123 • ensure_connected
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:527 • block in flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:542 • logging
config/initializers/moped_newrelic_instrumentation.rb:48 • block in logging_with_newrelic
vendor/bundle/ruby/1.9.1/gems/newrelic_rpm-3.4.2.1/lib/new_relic/agent/method_tracer.rb:242 • trace_execution_scoped
config/initializers/moped_newrelic_instrumentation.rb:45 • logging_with_newrelic
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:526 • flush
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:515 • process
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:341 • query
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cursor.rb:116 • block in load_docs
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/session/context.rb:109 • block in with_node
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cluster.rb:150 • block in with_primary
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/node.rb:168 • ensure_primary
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cluster.rb:149 • with_primary
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/session/context.rb:108 • with_node
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cursor.rb:115 • load_docs
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/cursor.rb:25 • each
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/query.rb:77 • each
vendor/bundle/ruby/1.9.1/gems/moped-1.2.2/lib/moped/query.rb:77 • each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:133 • block in each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:603 • selecting
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual/mongo.rb:132 • each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/contextual.rb:18 • each
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:619 • entries
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:619 • from_database
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:310 • multiple_from_map_or_db
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:176 • execute_or_raise
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/criteria.rb:243 • find
vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.6/lib/mongoid/finders.rb:61 • find
app/controllers/application_controller.rb:37 • current_user
durran added a commit that referenced this pull request Sep 24, 2012
Fixed a typo in the query failure handler of Node
@durran durran merged commit 7e20b3d into mongoid:master Sep 24, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants