Skip to content

Commit e54d300

Browse files
committed
Ignore SIGTERM notifications by Airbrake in successful deployment/restart
1 parent c5b2b76 commit e54d300

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

config/initializers/airbrake.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@
6868
# (under context/versions/dependencies).
6969
# Airbrake.add_filter(Airbrake::Filters::DependencyFilter.new)
7070

71+
# NOTE: SIGTERM is a standard signal sent by the hosting environment (e.g., Heroku)
72+
# when it needs to stop an existing Puma process, typically during a new deployment/restart.
73+
# Puma traps this signal, which surfaces as SignalException: SIGTERM in the stack trace from launcher.rb.
74+
# It does not necessarily indicate a bug in the application.
75+
Airbrake.add_filter do |notice|
76+
if notice.exception.is_a?(SignalException) && notice.exception.message == 'SIGTERM'
77+
notice.ignore!
78+
end
79+
end
80+
7181
# If you want to convert your log messages to Airbrake errors, we offer an
7282
# integration with the Logger class from stdlib.
7383
# https://github.com/airbrake/airbrake#logger

0 commit comments

Comments
 (0)