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

SignalExceptions still being raised in rake tasks #306

Closed
iftheshoefritz opened this issue Mar 12, 2019 · 4 comments
Closed

SignalExceptions still being raised in rake tasks #306

iftheshoefritz opened this issue Mar 12, 2019 · 4 comments

Comments

@iftheshoefritz
Copy link

iftheshoefritz commented Mar 12, 2019

When I upgraded the gem from 3.3 -> 4.2.1 SignalExceptions disappeared from my Puma processes (this is good). However they still remain in my long running rake tasks (this is bad).

I see in https://github.com/honeybadger-io/honeybadger-ruby/pull/269/files that SignalException is squashed in the at_exit callback. Is there something different about how install_at_exit_callbacks works for Rake?

The rake tasks are being invoked inside a container and managed by supervisord which invokes bundle exec rake myraketask. When the container is killed (after a deploy) the container sends SIGTERM which causes Ruby to raise SignalException. As per #269 this should be ignored.

# Gemfile
gem 'rails', '~> 5.0.7.1'
gem 'honeybadger', '~> 4.2.1'

Any thoughts?

@joshuap
Copy link
Member

joshuap commented Mar 12, 2019

The way our Rake integration works by default is that we report all errors that Rake displays (it's not related at all to at_exit):

https://github.com/honeybadger-io/honeybadger-ruby/blob/master/lib/honeybadger/init/rake.rb#L15

I think that it could make sense to automatically configure Honeybadger to ignore SystemExit and SignalException in Rake tasks. Since we don't currently have that, you could configure your app to ignore those exceptions locally:

https://docs.honeybadger.io/ruby/getting-started/ignoring-errors.html

If you only want the extra config inside Rake tasks (not the rest of your application), you could probably conditionally add the config with Honeybadger.configure and a check similar to this. If you're OK with never reporting those errors, then just adding the config should work:

exceptions:
  ignore:
    - !ruby/class 'SystemExit'
    - !ruby/class 'SignalException'

@iftheshoefritz
Copy link
Author

I think that it could make sense to automatically configure Honeybadger to ignore SystemExit and SignalException in Rake tasks

Opened #309 to do this

@joshuap
Copy link
Member

joshuap commented Apr 2, 2019

Responded on #309. I'll close this issue after I update docs.honeybadger.io with info on configuring Rake tasks to ignore these exceptions.

@joshuap
Copy link
Member

joshuap commented Apr 4, 2019

@joshuap joshuap closed this as completed Apr 4, 2019
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

2 participants