exception_notification
exception_notification copied to clipboard
Catch ActiveRecord::ConnectionTimeoutError
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
?
+1 for this hint
@WojtekKruszewski sounds right, can you create a PR for it?