ActsAsParanoid / acts_as_paranoid

ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
MIT License
1.46k stars 191 forks source link

Possible conflict between acts_as_paranoid and newrelic_rpm #280

Open mvz opened 2 years ago

mvz commented 2 years ago

In #93, @glindsey wrote:

I'm running into a similar issue in our codebase which appears to be a conflict between acts_as_paranoid and newrelic_rpm: both attempt to wrap delete_all which results in a callstack looking like:

/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:32 in each
/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:32 in find
/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:32 in match
/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:7 in respond_to?
/gems/activesupport-5.0.7.2/lib/active_support/core_ext/object/try.rb:6 in try
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:6 in paranoid?
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:23 in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:49 in block in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/transaction.rb:813 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent.rb:643 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:48 in delete_all
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:18 in delete_all!
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:26 in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:49 in block in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/transaction.rb:813 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent.rb:643 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:48 in delete_all
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:18 in delete_all!
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:26 in delete_all

...and so on, repeating those six frames over and over until the stack is exhausted.