-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.0.4
-
Component/s: None
-
Labels:None
-
Environment:Fedora 21-22 ; Debian 7-8
Hi, I got many times this issue on the count method. It appears randomly on a 5.000.000+ docs collection.
Timed out attempting to dequeue connection after 1 sec.
from: ["/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:175:in `wait_for_next!'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:161:in `block in dequeue_connection'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:157:in `loop'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:157:in `dequeue_connection'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:62:in `block in dequeue'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:61:in `synchronize'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool/queue.rb:61:in `dequeue'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connection_pool.rb:54:in `checkout'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/connec
tion_pool.rb:98:in `with_connection'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/server/context.rb:63:in `with_connection'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/operation/command.rb:50:in `execute'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/database.rb:136:in `command'",
"/usr/local/lib/ruby/gems/2.1.0/gems/mongo-2.0.4/lib/mongo/collection/view/readable.rb:124:in `count'",
"/home/backend_script/collect/inserteur/inserteur.rb:56:in `check_already_there_stream'"
The incriminated code is :
result = stream_coll.find(id_stream: st[:id_stream]) .sort('$natural' => -1) .limit(1) .projection(_id: 1, max_views: 1) .hint(id_stream: 1) if (result.count.eql? 0) == false