Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch ActiveRecord::ConnectionTimeoutError #273

Open
wkrsz opened this issue May 6, 2015 · 2 comments
Open

Catch ActiveRecord::ConnectionTimeoutError #273

wkrsz opened this issue May 6, 2015 · 2 comments

Comments

@wkrsz
Copy link

wkrsz commented May 6, 2015

I had misconfigured ActiveRecord connect pool: just enough connections for Puma but not for sucker_punch workers. Under higher load requests were failing with ActiveRecord::ConnectionTimeoutError. Unfortunately there was no notification because the exception was raised earlier in Rack middleware, before exception notifier.

I solved this by inserting exception notifier lower in middleware stack:

config.app_middleware.insert_before ActiveRecord::ConnectionAdapters::ConnectionManagement, ExceptionNotification::Rack

Maybe this should be a default in lib/exception_notification/rails.rb?

@woto
Copy link

woto commented Aug 29, 2015

+1 for this hint

@smartinez87
Copy link
Owner

@WojtekKruszewski sounds right, can you create a PR for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants