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

Fix concurrent ruby future propagation without active_trace #3242

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

TonyCTHsu
Copy link
Contributor

@TonyCTHsu TonyCTHsu commented Nov 7, 2023

What does this PR do?

Concurrent ruby propagation breaks with NoMethodError when there is no active_trace to propagates.

Fix with conditionals.

@TonyCTHsu TonyCTHsu added integrations Involves tracing integrations tracing labels Nov 7, 2023
@TonyCTHsu TonyCTHsu self-assigned this Nov 7, 2023
@TonyCTHsu TonyCTHsu added this to the 1.16.1 milestone Nov 7, 2023
@TonyCTHsu TonyCTHsu marked this pull request as ready for review November 7, 2023 11:28
@TonyCTHsu TonyCTHsu requested a review from a team as a code owner November 7, 2023 11:28
@@ -135,6 +135,18 @@
end
end
end

context 'when propagates without an active trace' do
it 'creates a root span' do
Copy link
Member

Choose a reason for hiding this comment

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

Fix looks good but that sounds weird. I would expect:

  • 'does nothing'
  • 'does not raise'
  • 'calls executor'


future.wait

expect(inner_span).to be_root_span
Copy link
Member

Choose a reason for hiding this comment

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

I understand that it indirectly test that it did not crash (because if it crashed the test would blow up), but does that actually test that it didn't append a span to the trace?

Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

We can address @lloeki concerns, but the fix itself looks good.

@TonyCTHsu
Copy link
Contributor Author

I am merging this to dish out a release as soon as possible.

@TonyCTHsu TonyCTHsu merged commit 583cdaa into master Nov 7, 2023
178 checks passed
@TonyCTHsu TonyCTHsu deleted the tonycthsu/fix-concurrent-ruby-future-propagation branch November 7, 2023 19:48
@TonyCTHsu TonyCTHsu mentioned this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.16.0: undefined method `to_digest' for nil:NilClass
3 participants