-
Couldn't load subscription status.
- Fork 802
opentelemetry-exporter-richconsole: prevent deadlock #3900
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
base: main
Are you sure you want to change the base?
Conversation
| while spans: | ||
| for span in spans: | ||
| if not span.parent: | ||
| if not span.parent or span.parent.span_id not in span_ids: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that the parent is part of the spans. If not, treat the child span as root span.
| ) | ||
| trees[trace_id] = Tree(label=f"Trace {trace_id}") | ||
| child = trees[trace_id].add( | ||
| tree = trees.setdefault(trace_id, Tree(label=f"Trace {trace_id}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid recreating the trace tree as now we can enter this branch for multiple spans.
| for child in trees[traceid_1].children[0].children | ||
| ) | ||
|
|
||
| def test_no_deadlock(tracer_provider): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed a non-regression test. However, if you run this with the old version, you will get a deadlock and CI etc. will hang. If that is not acceptable, we should add a timeout mechanism, e.g. pytest-timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, a quick timeout instead of the longer GH timeout would be nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you ok with me adding pytest-timeout as test dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, if you run this with the old version, you will get a deadlock and CI etc. will hang. If that is not acceptable
Why wouldn't it be acceptable? Seems OK to me
|
|
||
| ### Fixed | ||
|
|
||
| - `opentelemetry-instrumentation-richconsole`: Prevent deadlock when parent span is not part of the batch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `opentelemetry-instrumentation-richconsole`: Prevent deadlock when parent span is not part of the batch | |
| - `opentelemetry-exporter-richconsole`: Prevent deadlock when parent span is not part of the batch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clear description and fix!
| for child in trees[traceid_1].children[0].children | ||
| ) | ||
|
|
||
| def test_no_deadlock(tracer_provider): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, if you run this with the old version, you will get a deadlock and CI etc. will hang. If that is not acceptable
Why wouldn't it be acceptable? Seems OK to me
Description
Fixes #3254
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.