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

Destroying ActiveRecord objects results in SystemStackError when using newrelic_rpm #11

Open
kommen opened this issue Mar 21, 2016 · 0 comments

Comments

@kommen
Copy link
Member

kommen commented Mar 21, 2016

When having newrelic_rpm (version 3.15.0.314) as a dependency in a rails app together with postamt, destroying ActiveRecord records fails with an SystemStackError: stack level too deep.

The last stack frames look like:

from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.6/lib/active_record/relation.rb:304:in `ensure in scoping'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.6/lib/active_record/relation.rb:304:in `scoping'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:70:in `name'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent/instrumentation/active_record_helper.rb:53:in `delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/postamt-0.9.7/lib/postamt.rb:121:in `block in delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/postamt-0.9.7/lib/postamt.rb:19:in `on'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/postamt-0.9.7/lib/postamt.rb:121:in `delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent/instrumentation/active_record_helper.rb:54:in `block in delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent.rb:574:in `with_database_metric_name'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent/instrumentation/active_record_helper.rb:53:in `delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/postamt-0.9.7/lib/postamt.rb:121:in `block in delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/postamt-0.9.7/lib/postamt.rb:19:in `on'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/postamt-0.9.7/lib/postamt.rb:121:in `delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent/instrumentation/active_record_helper.rb:54:in `block in delete_all'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent.rb:574:in `with_database_metric_name'
    from /Users/kommen/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/newrelic_rpm-3.15.0.314/lib/new_relic/agent/instrumentation/active_record_helper.rb:53:in `delete_all'

The issue was not present with older newrelic_rpm versions (e.g. 3.9.0.229). This commit looks like it could be the cause: newrelic/newrelic-ruby-agent@9c267ff

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

1 participant