Skip to content
Snippets Groups Projects
Commit 9e0f8213 authored by Christian Wulf's avatar Christian Wulf
Browse files

fixed concurrency bug in TraceReductionFilter

parent 799658fa
No related branches found
No related tags found
No related merge requests found
...@@ -60,17 +60,14 @@ public class TraceReductionFilter extends ConsumerStage<TraceEventRecords, Trace ...@@ -60,17 +60,14 @@ public class TraceReductionFilter extends ConsumerStage<TraceEventRecords, Trace
} }
private void countSameTraces(final TraceEventRecords traceEventRecords, final long timestamp) { private void countSameTraces(final TraceEventRecords traceEventRecords, final long timestamp) {
TraceAggregationBuffer traceBuffer = this.trace2buffer.get(traceEventRecords); synchronized (this.trace2buffer) {
if (traceBuffer == null) { TraceAggregationBuffer traceBuffer = this.trace2buffer.get(traceEventRecords);
synchronized (this.trace2buffer) { if (traceBuffer == null) {
traceBuffer = this.trace2buffer.get(traceEventRecords); traceBuffer = new TraceAggregationBuffer(timestamp, traceEventRecords);
if (traceBuffer == null) { // NOCS (DCL) this.trace2buffer.put(traceEventRecords, traceBuffer);
traceBuffer = new TraceAggregationBuffer(timestamp, traceEventRecords);
this.trace2buffer.put(traceEventRecords, traceBuffer);
}
} }
traceBuffer.count();
} }
traceBuffer.count();
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment