Note that there are some explanatory texts on larger screens.

plurals
  1. POsidekiq sending class as args gives stacklevel too deep error
    text
    copied!<p>After setting up <a href="http://mperham.github.com/sidekiq/" rel="nofollow">sidekiq</a>, I observed a strange behavior with respect to the arguments passed to the <code>Sidekiq::Client.push</code> method</p> <p>If I give <code>self.class</code> as args, then I either get a <code>SystemStackError (stack level too deep)</code> OR the server simply hung up, thereafter accepting no request.</p> <p><code>Sidekiq::Client.enqueue(ActivityWorker, self.id, self.class)</code> </p> <pre><code>SystemStackError (stack level too deep): actionpack (3.2.12) lib/action_dispatch/middleware/reloader.rb:70 Rendered /usr/local/rvm/gems/ruby-1.9.3-p194@restro/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.0ms) Rendered /usr/local/rvm/gems/ruby-1.9.3-p194@restro/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.0ms) Rendered /usr/local/rvm/gems/ruby-1.9.3-p194@restro/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (37.8ms) </code></pre> <p>But if I give <code>self.class.name</code> then it works without any flaw. <code>Sidekiq::Client.enqueue(ActivityWorker, self.id, self.class.name)</code> </p> <p>I found that the args are serialized before they are passed to the worker, but am unable to figure out this scenario.</p> <p>Here's my Worker class</p> <pre><code>class ActivityWorker include Sidekiq::Worker sidekiq_options queue: 'high', retry: false def perform(res_id, res_class) # do some activity end end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload