Skip to content

Commit

Permalink
Fixed concurrency crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mamunto committed Jul 11, 2024
1 parent 31d22dc commit 636ce19
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SynchronousMetricStorage: SynchronousMetricStorageProtocol {
var aggregatorHandles = [[String: AttributeValue]: AggregatorHandle]()
let attributeProcessor: AttributeProcessor
var aggregatorHandlePool = [AggregatorHandle]()
private let aggregatorHandlesQueue = DispatchQueue(label: "org.opentelemetry.SynchronousMetricStorage.aggregatorHandlesQueue", attributes: .concurrent)
private let aggregatorHandlesQueue = DispatchQueue(label: "org.opentelemetry.SynchronousMetricStorage.aggregatorHandlesQueue")


static func empty() -> SynchronousMetricStorageProtocol {
Expand Down Expand Up @@ -76,7 +76,7 @@ public class SynchronousMetricStorage: SynchronousMetricStorageProtocol {

var points = [PointData]()

aggregatorHandlesQueue.sync(flags: .barrier) {
aggregatorHandlesQueue.sync {
aggregatorHandles.forEach { key, value in
let point = value.aggregateThenMaybeReset(startEpochNano: start, endEpochNano: epochNanos, attributes: key, reset: reset)
if reset {
Expand Down

0 comments on commit 636ce19

Please sign in to comment.