diff --git a/Changes.md b/Changes.md index 96838bf9..be240278 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,7 @@ 2.3.1 ----------- +- Re-enable Celluloid::Actor#defer to fix stack overflow issues [#398] - Add support for multiple processes per host to Capistrano recipe 2.3.0 diff --git a/lib/sidekiq/processor.rb b/lib/sidekiq/processor.rb index c09b3147..63adadbc 100644 --- a/lib/sidekiq/processor.rb +++ b/lib/sidekiq/processor.rb @@ -32,19 +32,21 @@ module Sidekiq end def process(msgstr, queue) - begin - msg = Sidekiq.load_json(msgstr) - klass = constantize(msg['class']) - worker = klass.new + defer do + begin + msg = Sidekiq.load_json(msgstr) + klass = constantize(msg['class']) + worker = klass.new - stats(worker, msg, queue) do - Sidekiq.server_middleware.invoke(worker, msg, queue) do - worker.perform(*cloned(msg['args'])) + stats(worker, msg, queue) do + Sidekiq.server_middleware.invoke(worker, msg, queue) do + worker.perform(*cloned(msg['args'])) + end end + rescue Exception => ex + handle_exception(ex, msg || { :message => msgstr }) + raise end - rescue Exception => ex - handle_exception(ex, msg || { :message => msgstr }) - raise end @boss.processor_done!(current_actor) end diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index 9b5e317d..f7b69802 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,3 +1,3 @@ module Sidekiq - VERSION = "2.3.0" + VERSION = "2.3.1" end