diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bcf45f76b9..cbeea9dd1f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## [Unreleased] +## [0.35.1] - 2020-05-05 + +Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.35.1 + +Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.35.0...v0.35.1 + +### Fixed + +- Components#teardown! NoMethodError (#1021, #1023) (@bzf) + ## [0.35.0] - 2020-04-29 Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.35.0 @@ -1195,7 +1205,8 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1 Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1 -[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.35.0...master +[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.35.1...master +[0.35.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.35.0...v0.35.1 [0.35.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.34.2...v0.35.0 [0.34.2]: https://github.com/DataDog/dd-trace-rb/compare/v0.34.1...v0.34.2 [0.34.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.34.0...v0.34.1 diff --git a/lib/ddtrace/configuration/components.rb b/lib/ddtrace/configuration/components.rb index 2dee58cc5b3..afdc5c58b3b 100644 --- a/lib/ddtrace/configuration/components.rb +++ b/lib/ddtrace/configuration/components.rb @@ -135,13 +135,13 @@ def teardown!(replacement = nil) old_statsd = [ runtime_metrics.metrics.statsd, health_metrics.statsd - ].uniq + ].compact.uniq new_statsd = if replacement [ replacement.runtime_metrics.metrics.statsd, replacement.health_metrics.statsd - ].uniq + ].compact.uniq else [] end diff --git a/lib/ddtrace/version.rb b/lib/ddtrace/version.rb index db37a5244eb..2f373b5fd2b 100644 --- a/lib/ddtrace/version.rb +++ b/lib/ddtrace/version.rb @@ -2,7 +2,7 @@ module Datadog module VERSION MAJOR = 0 MINOR = 35 - PATCH = 0 + PATCH = 1 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') diff --git a/spec/ddtrace/configuration/components_spec.rb b/spec/ddtrace/configuration/components_spec.rb index 0aaff03f7b5..a92474a4fb9 100644 --- a/spec/ddtrace/configuration/components_spec.rb +++ b/spec/ddtrace/configuration/components_spec.rb @@ -673,6 +673,25 @@ teardown! end + + context 'and Statsd is not initialized' do + before do + allow(components.runtime_metrics.metrics) + .to receive(:statsd) + .and_return(nil) + end + + it 'shuts down all components' do + expect(components.tracer).to receive(:shutdown!) + expect(components.runtime_metrics).to receive(:enabled=) + .with(false) + expect(components.runtime_metrics).to receive(:stop) + .with(true) + expect(components.health_metrics.statsd).to receive(:close) + + teardown! + end + end end context 'when the tracer is re-used' do