Closed TRex22 closed 1 year ago
Hi @TRex22. Thanks for sharing this issue and the steps to reproduce it. We will take a look.
In the meantime, we were wondering if you recently upgraded your Ruby agent? We added additional support for ActionCable (specifically caching-related activities #1742), in 8.16.0 and are wondering if this is related.
Hi @hannahramadan we recently upgraded from 9.0.0
-> 9.1.0
but were experiencing similar issues on 9.0.0
although the Gem did seem to crash less. Was quite difficult to figure out what was going on.
Thanks @TRex22. We're still working on the reproduction. Do you still see the error if you turn off Active Support instrumentation? You can do this by adding the following to your newrelic.yml
:
disable_active_support: true
Hey @hannahramadan Im currently on leave (for the next two weeks) but Ive forwarded the question to my colleague. He is working on using the In-Memory cache and could possibly try that configuration setting.
Hi @TRex22 - have you (or your colleague) had a chance to try things out with Active Support instrumentation disabled or found any other leads on what could be causing issues?
Your stack trace points to a JSON dump operation that should work fine natively with all agent-supported Rubies (v2.4+), but unfortunately, a "not-implemented" error is happening. Any ideas on anything that could impact JSON functionality in the environment?
@TRex22 - we're unable to reproduce the issue after setting up a Rails 5.2.8.1 and Ruby 2.7.7 app that uses the provided initializer and controller code, with combinations of static and dynamic key values and force
either true or false. We're currently thinking that there must be something else (a gem in Gemfile, additional usage workflow, etc.) needed to make the repro work. If you are able to set up and share a reproduction repository, we would love to take a look.
As for the question on JSON earlier, the stack trace seems to indicate that the (built-in) Ruby JSON library reports 'dump' as not implemented. But when we do require 'json'; ::JSON.methods(false).include?(:dump)
it returns true for us. We're puzzled as to why the NotImplementedError is happening when the cache store is swapped out.
I'm going to remove the bug label for now for housekeeping.
Hi @TRex22 I'm closing this issue for now but please reopen it if there is anything we can do to help.
Sorry I missed your responses ... I think because we use the gem OJ
that might explain this issue. But havent confirmed. We ended up not implementing this kind of cache store and going with a different solution.
Description
We have a web request which calls a service. The service module makes use of a
ActiveSupport::Cache::MemoryStore
. When called with thenewrelic_rpm
present and active it causes the Gem to raise aNotImplementedError
. The effect of this is that it drastically slows down the web request. Takes about double the time to respond.I struggled with whether this is a bug of feature request, but I feel the negative effects of the error constitutes it being a bug.
Expected Behaviour
The gem should notify in the logs that this is not supported but should fail gracefully and either still send to NewRelic or skip the send but not hold up the request.
Troubleshooting or NR Diag results
Steps to Reproduce
In a Rails config initializer define an InMemoryCache (for testing)
In a Rails controller action invoke the in-memory store
We added a feature toggle for the in-memory cache and found the exception went away when we turned the in-memory cache off.
Your Environment
Ruby version: 2.7.7 Rails Version: 5.2.8.1 newrelic_rpm version: 9.1.0
NEW_RELIC_INSTRUMENTATION_THREAD_TRACING
is set tofalse
Additional context
For Maintainers Only or Hero Triaging this bug
Suggested Priority (P1,P2,P3,P4,P5): Suggested T-Shirt size (S, M, L, XL, Unknown):