-
Notifications
You must be signed in to change notification settings - Fork 96
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: process parallel events and potential deadlock in on_record
#95
Conversation
This deadlock can happen when extensions of a span are locked while we visit either an event or attributes of a span. A `Debug` implementation can also try to access the extensions which results in a deadlock. See tokio-rs#59 and tokio-rs#95 for additional information.
743f8d9
to
d90b437
Compare
on_record
I've dug into it a bit more and found out #59 fixed the deadlock only in Benchmark against current HEADThe results here seem hopeful that this is actually even improvement. But again, first time really using criterion so if you double-checked it, it would be great.
Sorry for the late change to this. |
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.
I think this looks good. We may have been affected by the loss of parallel events, too -- would be nice to get this into the next release.
@jtescher do you think you'll have some time to take a look at this? I'd like to try and tackle the span limits next but I think it should be built upon this so I'd like to have even a soft go-ahead on this first. |
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 this looks like a reasonable solution to the concurrent otel data access. Thanks @mladedav
Motivation
#94 - Mutli-threaded tracing drops most of the events
Solution
I have reorganized the code so that the lock on extensions is held, but not while
record
is called which should solve the deadlock originally solved in #59Benchmark
I've used the benchmark from #93, please ignore the "filtered" vs "non_filtered" distinction, for the purpose of this PR they should be identical cases.
See results in later comment as the code got changed.