You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is caused by the OpenTelemetryLayer taking the OtelData from extensions, mutating the events and then replacing it back. If some other thread tries to log an event in the meantime and doesn't find OtelData in the extensions, that event will be lost.
Important context is #59 which is also the reason we cannot simply take a unique reference to the metadata because it might cause a deadlock. More context concerning that:
## 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 #59
### Benchmark
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.
Bug Report
Version
Current HEAD in git:
101dc89 (origin/v0.1.x, origin/HEAD) Honor explicit parent spans for events (#92)
For completeness sake:
Platform
Linux silver 6.1.71-1-MANJARO #1 SMP PREEMPT_DYNAMIC Fri Jan 5 17:36:36 UTC 2024 x86_64 GNU/Linux
Description
When events are emitted for the same span from multiple threads, some of them may be lost due to race conditions.
Repro is here
This is caused by the
OpenTelemetryLayer
taking theOtelData
from extensions, mutating the events and then replacing it back. If some other thread tries to log an event in the meantime and doesn't findOtelData
in the extensions, that event will be lost.Important context is #59 which is also the reason we cannot simply take a unique reference to the metadata because it might cause a deadlock. More context concerning that:
The text was updated successfully, but these errors were encountered: