mongoid/mongoid — Issue #1729: HostAndPort: bad config string
Author: fbjork
Created: 2012-02-17 23:16:52+00:00
State: open

I'm getting the following error in Sidekiq (https://github.com/mperham/sidekiq) workers that use threads:

```ruby
Mongo::OperationFailure: HostAndPort: bad config string
/app/vendor/bundle/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/cursor.rb:101:in `next_document'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/cursor.rb:49:in `block in each'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/collections/retry.rb:29:in `retry_on_connection_failure'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/cursor.rb:48:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/contexts/mongo.rb:257:in `iterate'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/criteria.rb:145:in `block in each'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/criteria.rb:145:in `tap'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/criteria.rb:145:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/relations/targets/enumerable.rb:153:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/relations/referenced/many.rb:441:in `none?'
/app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.4.3/lib/mongoid/relations/referenced/many.rb:441:in `method_missing'
/app/app/workers/recent_checkins_worker.rb:5:in `perform'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/processor.rb:39:in `block (2 levels) in process'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:71:in `call'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:71:in `block in invoke'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/server/failure_jobs.rb:10:in `call'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:73:in `block in invoke'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:73:in `block in invoke'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/server/unique_jobs.rb:10:in `call'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:73:in `block in invoke'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/server/airbrake.rb:9:in `call'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:73:in `block in invoke'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:76:in `call'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/middleware/chain.rb:76:in `invoke'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/processor.rb:38:in `block in process'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/processor.rb:67:in `stats'
/app/vendor/bundle/ruby/1.9.1/bundler/gems/sidekiq-9dbaad8c1538/lib/sidekiq/processor.rb:37:in `process'
/app/vendor/bundle/ruby/1.9.1/gems/celluloid-0.8.0/lib/celluloid/calls.rb:93:in `dispatch'
/app/vendor/bundle/ruby/1.9.1/gems/celluloid-0.8.0/lib/celluloid/actor.rb:181:in `block in handle_message'
/app/vendor/bundle/ruby/1.9.1/gems/celluloid-0.8.0/lib/celluloid/task.rb:45:in `block in initialize'
```

Is mongoid not thread safe?