Sidekiq not closing connections after failure in Job

46 views
Skip to first unread message

Vishal Ramrakhyani

unread,
Jan 3, 2017, 8:32:12 AM1/3/17
to Sidekiq
Does sidekiq close ActiveRecord connections after a job is failed due to code issue or any reason? 

For me it is not closing connections and that leads to ConnectionTimeOut issue with Sidekiq. Can anyone provide me any inputs on this?

Mike Perham

unread,
Jan 3, 2017, 12:57:58 PM1/3/17
to sid...@googlegroups.com
If you use the sidekiq_retries_exhausted block, you need to manage the connection manually, as noted in the wiki documentation:

https://github.com/mperham/sidekiq/wiki/Error-Handling#configuration

sidekiq_retries_exhausted do |…|
  MyModel.connection_pool.with_connection do
    MyModel.find(…)
  end
end

On Tue, Jan 3, 2017 at 5:32 AM, Vishal Ramrakhyani <vishal.ramrakhyani@zoomcar.com> wrote:
Does sidekiq close ActiveRecord connections after a job is failed due to code issue or any reason? 

For me it is not closing connections and that leads to ConnectionTimeOut issue with Sidekiq. Can anyone provide me any inputs on this?

--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/99f98b81-3dcb-4fcf-b26a-5cb35a91e065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mike Perham – CEO, Contributed Systems
Smart, effective open source infrastructure for your apps.
Reply all
Reply to author
Forward
0 new messages