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

Add tests to confirm known deadlock issues #2199

Merged
merged 3 commits into from
Oct 12, 2024

Conversation

cijothomas
Copy link
Member

Adding test to repro #1745

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 45 lines in your changes missing coverage. Please review.

Project coverage is 79.1%. Comparing base (b6a108e) to head (98e1be2).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-appender-tracing/src/layer.rs 0.0% 45 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2199     +/-   ##
=======================================
- Coverage   79.2%   79.1%   -0.2%     
=======================================
  Files        121     121             
  Lines      20964   21009     +45     
=======================================
  Hits       16620   16620             
- Misses      4344    4389     +45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

impl LogExporter for ReentrantLogExporter {
async fn export(&mut self, _batch: LogBatch<'_>) -> LogResult<()> {
// This will cause a deadlock as the export itself creates a log
// while still within the lock of the SimpleLogProcessor.
Copy link
Member

@lalitb lalitb Oct 12, 2024

Choose a reason for hiding this comment

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

wondering if we should bring the message queue back for simple log processor ?

Copy link
Member Author

Choose a reason for hiding this comment

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

that might mitigate the issue temporarily, but we need to solve it via context based suppression I think.

Copy link
Member

Choose a reason for hiding this comment

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

In context-based suppression, there may still be cases where we want to loop back the internal events at least once. This could potentially result in a deadlock situation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I follow that. Maybe add a unit test to cover the scenario, so its easy to track.

Copy link
Member

@lalitb lalitb Oct 14, 2024

Choose a reason for hiding this comment

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

I meant - even with the suppression logic in place, we may want the internal errors to loop-back to the pipeline once, hoping that the error is transient and doesn't cause infinite loop. In case of non-transient errors, the subsequent error is suppressed. But this can be something discussed when we look into suppression logic.

Not related to this, but moving to message queue will also fix hang issue - #2071 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

we may want the internal errors to loop-back to the pipeline once, hoping that the error is transient and doesn't cause infinite loop

Can you share a scenario where this is needed? I am not sure how often it is feasible for a component to determine if an error is transient or not.

Not related to this, but moving to message queue will also fix hang issue - #2071 (comment)

Yes, likely. But this needs a full redesign. I don't think adding a queue in the middle helps all cases.

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks for the tests. nit comments, with the lint fix - should be good to merge.

@cijothomas cijothomas merged commit caa4246 into open-telemetry:main Oct 12, 2024
24 of 25 checks passed
@cijothomas cijothomas deleted the cijothomas/deadlock-test branch October 12, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants