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

Concurrent Ruby: Stop assuming a version number is available where we expect it to be #2464

Closed
fallwith opened this issue Feb 26, 2024 · 4 comments · Fixed by #2466
Closed
Labels

Comments

@fallwith
Copy link
Contributor

Currently the agent will assume that the Concurrent::VERSION constant exists as long as the Concurrent constant is defined. We perform a version check to ensure that version 1.1.5 or higher is in play before instrumenting the gem.

We have learned from a customer with with Concurrent Ruby version 1.1.6 that it is possible for Concurrent Ruby to satisfy the Concurrent check but fail to provide Concurrent::VERSION. This results in the Concurrent Ruby instrumentation erroring out. Given that each instrumentation's routines are siloed, the only real ill effect is error messages hitting the agent log.

We should confirm that Concurrent::VERSION exists prior to using its value in a numeric comparison with our minimum supported gem version.

@fallwith fallwith added the bug label Feb 26, 2024
@workato-integration
Copy link

@workato-integration workato-integration bot changed the title Concurrent Ruby: Stop assuming a version number is available where we expect it to be Concurrent Ruby: Stop assuming a version number is available where we expect it to be Feb 26, 2024
@fallwith
Copy link
Contributor Author

Here's the relevant observed newrelic_agent.log message:

DEBUG : Using auto configuration value for concurrent_ruby to configure instrumentation
ERROR : Error while detecting concurrent_ruby:
ERROR : NameError: uninitialized constant Concurrent::VERSION
DEBUG : Debugging backtrace:
$HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/agent/instrumentation/concurrent_ruby.rb:14:in `block (2 levels) in <top (required)>'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:126:in `block in check_dependencies'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:124:in `each'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:124:in `all?'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:124:in `check_dependencies'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:64:in `dependencies_satisfied?'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:28:in `block in detect!'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:27:in `each'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/dependency_detection.rb:27:in `detect!'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/control/instrumentation.rb:64:in `_install_instrumentation'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/control/instrumentation.rb:47:in `install_instrumentation'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/control/private_instance_methods.rb:39:in `init_instrumentation'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/new_relic/control/instance_methods.rb:75:in `init_plugin'
  $HOME/.asdf/installs/ruby/2.5.7/lib/ruby/gems/2.5.0/gems/newrelic_rpm-9.7.1/lib/newrelic_rpm.rb:40:in `<top (required)>'

@fallwith
Copy link
Contributor Author

The version constant Concurrent::VERSION exists in the oldest available version of the gem, v0.7.0. So this doesn't appear to be a version issue.

@fallwith
Copy link
Contributor Author

fallwith commented Feb 27, 2024

We don't have a repro, but #2466 is a bit more paranoid with an extra defined? check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant