Added try/finally around event.execute() for RingBufferLogEventHandler to clear memory correctly in case of exception/error
@@ -42,13 +42,17 @@ public class RingBufferLogEventHandler implements
@Override
public void onEvent(final RingBufferLogEvent event, final long sequence,
final boolean endOfBatch) throws Exception {
+ try {
event.execute(endOfBatch);
+ }
+ finally {
event.clear();
// notify the BatchEventProcessor that the sequence has progressed.
// Without this callback the sequence would not be progressed
// until the batch has completely finished.
notifyCallback(sequence);
}
+ }
private void notifyCallback(long sequence) {
if (++counter > NOTIFY_PROGRESS_THRESHOLD) {
