-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
sentry + eager_load breaks ActiveJob rescue_from #1249
Comments
This return should not happen, from my limited understanding: https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/active_job.rb#L30 |
@CroneKorkN we've introduced several improvements to the SDK since |
Update: I can now reproduce the issue and have found the cause. ContextRails' initializers runs in this order:
Because we want to avoid injecting any Sentry extension into Rails unless the SDK is initialized (some users don't even initialize the SDK in dev environment), all patches are applied in the The ProblemThis approach works fine for most patches, but it's the root cause of this issue. The reason is that the When
|
* Correct the timing of loading ActiveJobExtensions See #1249 (comment) * Update changelog
Describe the bug
Sentry eats errors in Jobs. They return nil instead.
To Reproduce
rails c
ErrorJob.perform_later
Expected behavior
This line should never be executed because the line before it throws an error: https://github.com/CroneKorkN/sentry_broken_with_eager_load/blob/master/app/jobs/error_job.rb#L4
You should not see
>>> I SHOULD NEVER BE EXECUTED! (NilClass)
Actual behavior
The line is executed because
block.call
returnsnil
.You see
>>> I SHOULD NEVER BE EXECUTED! (NilClass)
Environment
Raven Config
https://github.com/CroneKorkN/sentry_broken_with_eager_load/blob/master/config/initializers/sentry.rb
Test Repo
On this commit, the error occurs: https://github.com/CroneKorkN/sentry_broken_with_eager_load/tree/0734f3648f9687c27f3f8ea505b1b26f5975cd97
This commit fixes it by disabling eager_load: https://github.com/CroneKorkN/sentry_broken_with_eager_load/tree/ddf2e41ebee1b31afb5c533601048ae740bb00f6
Removing the sentry-rails gem obviously also fixes it.
The text was updated successfully, but these errors were encountered: