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

Guard the rails core extensions against null Redis registry #357

Merged
merged 2 commits into from
Feb 28, 2018

Conversation

pschambacher
Copy link
Contributor

/cc @delner @palazzem

Here's the stack trace:

/gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/core_extensions.rb:313:in `reload_cache_store': undefined method `patched?' for nil:NilClass (NoMethodError)
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/core_extensions.rb:193:in `patch_cache_store'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/active_support.rb:11:in `instrument'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/railtie.rb:16:in `block in <class:Railtie>'
	from /gems/activesupport-3.2.22.4/lib/active_support/lazy_load_hooks.rb:34:in `call'
	from /gems/activesupport-3.2.22.4/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
	from /gems/activesupport-3.2.22.4/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
	from /gems/activesupport-3.2.22.4/lib/active_support/lazy_load_hooks.rb:25:in `each'
	from /gems/activesupport-3.2.22.4/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
	from /gems/railties-3.2.22.4/lib/rails/railtie/configuration.rb:59:in `after_initialize'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/railtie.rb:11:in `<class:Railtie>'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/railtie.rb:7:in `<module:Datadog>'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/railtie.rb:5:in `<top (required)>'
	from /gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:251:in `block in require'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:236:in `load_dependency'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:251:in `require'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace/contrib/rails/patcher.rb:50:in `<top (required)>'
	from /gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:251:in `block in require'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:236:in `load_dependency'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:251:in `require'
	from /gems/ddtrace-0.12.0.beta1/lib/ddtrace.rb:57:in `<top (required)>'
	from /gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /gems/bootsnap-1.1.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:251:in `block in require'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:236:in `load_dependency'
	from /gems/activesupport-3.2.22.4/lib/active_support/dependencies.rb:251:in `require'
	from ./test/lib/datadog_apm_test.rb:2:in `<main>' # require 'ddtrace'

From what I understand, the rails patcher triggers the railtie which loads the core extensions of Rails which expects the redis patcher to be registered. Sadly it's not yet because it's lower down the list of requires.

@delner delner added bug Involves a bug dev/testing Involves testing processes (e.g. RSpec) labels Feb 28, 2018
@delner delner self-assigned this Feb 28, 2018
@delner delner added this to the 0.12.0 milestone Feb 28, 2018
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@delner delner merged commit d6c0375 into DataDog:master Feb 28, 2018
delner pushed a commit that referenced this pull request Feb 28, 2018
* Guard the rails core extensions against null Redis registry
@delner delner modified the milestones: 0.12.0, 0.11.3 Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants