-
Notifications
You must be signed in to change notification settings - Fork 870
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainersGood for taking. Extra help will be provided by maintainerspkg:OpenTelemetryIssues related to OpenTelemetry NuGet packageIssues related to OpenTelemetry NuGet package
Description
Package
OpenTelemetry
Package Version
| Package Name | Version |
|---|---|
| OpenTelemetry | 1.11.2 |
Runtime Version
net8.0
Description
The Rent() method of LogRecordSharedPool is not thread safe and this causes the same LogRecord to be given out multiple times and then the data from one is overwritten or combined into a single log which then gets submitted twice.
Steps to Reproduce
I'm trying to come up with a unit test but there is such a small window that it is difficult. I can say in a full working system with many threads and logs that a small percentage of the logs are lost.
Expected Result
LogRecordSharedPool.Rent() should never return the same LogRecord no matter the load.
Actual Result
One log will be sent twice with a merge of attributes from two different logs and one Body will win. The ID is identical.
Additional Context
By forcing the use of the LogRecordThreadStaticPool this never happens.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainersGood for taking. Extra help will be provided by maintainerspkg:OpenTelemetryIssues related to OpenTelemetry NuGet packageIssues related to OpenTelemetry NuGet package