提交 b5e00fe2 编写于 作者: wu-sheng's avatar wu-sheng

fix: event handler memory leak, buffer never be cleared

上级 e750b540
......@@ -35,11 +35,15 @@ public class StoreAckSpanEventHandler implements EventHandler<AckSpanData> {
buffer.add(event);
if (endOfBatch || buffer.size() == bufferSize) {
IndexMetaCollection collection = fileWriter.write(buffer);
try {
IndexMetaCollection collection = fileWriter.write(buffer);
operator.batchUpdate(collection);
operator.batchUpdate(collection);
HealthCollector.getCurrentHeathReading("StoreAckSpanEventHandler").updateData(HeathReading.INFO, "%s messages were successful consumed .", buffer.size());
HealthCollector.getCurrentHeathReading("StoreAckSpanEventHandler").updateData(HeathReading.INFO, "%s messages were successful consumed .", buffer.size());
} finally {
buffer.clear();
}
}
}
}
......@@ -35,11 +35,15 @@ public class StoreRequestSpanEventHandler implements EventHandler<RequestSpanDat
buffer.add(event);
if (endOfBatch || buffer.size() == bufferSize) {
IndexMetaCollection collection = fileWriter.write(buffer);
try {
IndexMetaCollection collection = fileWriter.write(buffer);
operator.batchUpdate(collection);
operator.batchUpdate(collection);
HealthCollector.getCurrentHeathReading("StoreRequestSpanEventHandler").updateData(HeathReading.INFO, "%s messages were successful consumed .", buffer.size());
HealthCollector.getCurrentHeathReading("StoreRequestSpanEventHandler").updateData(HeathReading.INFO, "%s messages were successful consumed .", buffer.size());
} finally {
buffer.clear();
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册