mperham/sidekiq — Issue #11: NoMethodError: undefined method `clear_active_connections!' for ActiveRecord::Base:Class
Author: willcodeforfoo
Created: 2012-02-09 03:39:51+00:00
State: open

I've just started to play around with sidekiq a bit, and after generating a new Rails 3.1.2 app on Ruby 1.9.3 I toyed around with the following trivial worker:

```ruby
class FetchWorker
include Sidekiq::Worker

def perform(url)
puts url
sleep 0.5
end
end
```

Running this...

```
rails r '100.times {|i| FetchWorker.perform_async("http://www.example.com?n=#{i}") }'
```

...resulted in quite a few messages like the following to the terminal where `sidekiq` was running:

```
E, [2012-02-08T22:34:59.972354 #58448] ERROR -- : Sidekiq::Processor crashed!
NoMethodError: undefined method `clear_active_connections!' for ActiveRecord::Base:Class
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/middleware.rb:86:in `call'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/processor.rb:26:in `block in invoke_chain'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/middleware.rb:64:in `call'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/processor.rb:26:in `block in invoke_chain'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/processor.rb:29:in `call'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/processor.rb:29:in `invoke_chain'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/sidekiq-0.5.1/lib/sidekiq/processor.rb:16:in `process'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/celluloid-0.8.0/lib/celluloid/calls.rb:93:in `dispatch'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/celluloid-0.8.0/lib/celluloid/actor.rb:181:in `block in handle_message'
/Users/kmarsh/.rvm/gems/ruby-1.9.3-p0/gems/celluloid-0.8.0/lib/celluloid/task.rb:45:in `block in initialize'
```

I'm not sure if it resulted in any loss of jobs, it seems like they all ran... but there might be something up. I'm going to familiarize myself a bit more with the sidekiq code and see what I can make of it.