-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Removing ActiveJob::DeserializationError as a default ignored exception #1071
Comments
@calvinhughes you took the words right out of my mouth! We actually just ran into a very similar issue with Sentry ignoring
We don't discard jobs from Active Job when # frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
discard_on ActiveRecord::RecordNotFound
end |
@calvinhughes @agrobbin thanks for both of your opinions! since so here's what I'm going to do:
wdyt? |
That seems like a great plan to me @st0012! |
@st0012 Sounds great! |
sorry for the long waiting. I've added #1180 to address this issue (in the new SDK) 🙂 |
…lizationError (#1180) * Turn on inspect_exception_causes_for_exclusion by default With this config turned on, we can avoid matching the surface exceptions in integrations, which could cause issues like #1071. Solves #642. * Remove ActiveJob::DeserializationError from ignored list Since the previous commit solves #642, this commit can remove ActiveJob::DeserializationError from the ignored exceptions list. Solves #1071. * Update async document * Update changelog
…lizationError (#1180) * Turn on inspect_exception_causes_for_exclusion by default With this config turned on, we can avoid matching the surface exceptions in integrations, which could cause issues like #1071. Solves #642. * Remove ActiveJob::DeserializationError from ignored list Since the previous commit solves #642, this commit can remove ActiveJob::DeserializationError from the ignored exceptions list. Solves #1071. * Update async document * Update changelog
* Add ThreadsInterface (#1178) * Add ThreadsInterface * Update changelog * Inspect exception cause by default & don't exclude ActiveJob::DeserializationError (#1180) * Turn on inspect_exception_causes_for_exclusion by default With this config turned on, we can avoid matching the surface exceptions in integrations, which could cause issues like #1071. Solves #642. * Remove ActiveJob::DeserializationError from ignored list Since the previous commit solves #642, this commit can remove ActiveJob::DeserializationError from the ignored exceptions list. Solves #1071. * Update async document * Update changelog * Make sentry-rails a Rails engine and provide default job class for async (#1181) * Make sentry-rails a Rails engine too * Add Sentry::SendEventJob Instead of letting users defining their SentryJob class, we should provide a default job class for them. * Update document and example for the new job class * Update changelog * Add configuration option for trusted proxies (#1126) * Add configuration option for trusted proxies * Add `trusted_proxies` configuration option to sentry-ruby * Add existing ActionDispatch `trusted_proxies` values * Address some PR feedback * Isolate trusted proxy test configuration * Add comments to explain why we reverse the forwarded_for ip list * Call `uniq` on the trusted proxy list * Rename `filter_local_addresses(ips) to filter_trusted_proxy_addresses(ips) * Remove duplicated hash entry * Update some tests after PR feedback * retrigger checks Co-authored-by: Stan Lo <stan001212@gmail.com> * Only define SendEventJob when ActiveJob is defined * Allow users to configure ActiveJob adapters to ignore (#1256) * Allow users to configure ActiveJob adapters to ignore * Update changelog * Add sidekiq adapter to sentry-rails' ignored adapters list (#1257) * Add sidekiq adapter to sentry-rails' ignored adapters list * Update changelog * Tag queue name and jid on sidekiq events (#1258) * Add queue name and jid to event tags * Update changelog * Tag job_id and provider_job_id on ActiveJob events (#1259) * Refactor/test ActiveJob's context data * Tag job_id and provider_job_id on ActiveJob events * Update changelog * Add ability to have many post initialization callbacks (#1261) * Add ability to have many post initialization callbacks * Revert version bumping, fix codestyle and rewrite rspec test * Remove dependenciy bumping from sentry-sidekiq * Add entries to CHANGELOG * Support config.before_breadcrumb (#1253) * Support config.before_breadcrumb Example: ``` config.before_breadcrumb = lambda do |breadcrumb, hint| breadcrumb.message = "foo" breadcrumb end ``` * Update changelog * Update sentry-ruby's changelog * Update sentry-rails' changelog * Update sentry-sidekiq's changelog * Rename ignored_active_job_adapters to skippable_job_adapters (#1264) * Update sentry-ruby's changelog Co-authored-by: Jon-Erik Schneiderhan <45184220+jeschneiderhan@users.noreply.github.com> Co-authored-by: Valentine Kiselev <mrexox@outlook.com>
…lizationError (#1180) * Turn on inspect_exception_causes_for_exclusion by default With this config turned on, we can avoid matching the surface exceptions in integrations, which could cause issues like #1071. Solves #642. * Remove ActiveJob::DeserializationError from ignored list Since the previous commit solves #642, this commit can remove ActiveJob::DeserializationError from the ignored exceptions list. Solves #1071. * Update async document * Update changelog
Summary
Recently in an ActiveJob worker we faced an issue where an exception was raised during deserialization of the arguments due to some database connection issues. This raised an
ActiveJob::DeserializationError
exception, which was caused by the following:Because the
ActiveJob::DeserializationError
is ignored by default then this was not sent to Sentry.The exception was added due to #701 and #642 where it was assumed that this is only raised when a record cannot be found but like the case above this is not the case. It's easy enough to fix in a particular app as it can just be removed from the default ignored exceptions but I feel like it could trip up new users of the gem using ActiveJob.
It would be great if we could somehow report these legitimate errors, and still ignore the NotFound type errors due to the intentioned lined out in the issues above.
We have the
inspect_exception_causes_for_exclusion
config option for the SDK. I understand that was added to not change the behaviour for existing users, but are there any plans for making that the default in the future?If there are, I suppose we could just remove
ActiveJob::DeserializationError
when that happens as the NotFound style deserialization errors would be caught viaActiveRecord::RecordNotFound
through the ExceptionCauseChain middleware.Or if it remains solely to avoid the
SentryJob
example breaking when it isn't able to find a record, an alternative could be to remove it and update the async example to discard the job upon encountering a deserialization error viadiscard_on
.Wondered what your thoughts were, especially as the gem is currently undergoing a revamp. Happy to help with a PR too!
The text was updated successfully, but these errors were encountered: