Program: 7874
Project: 7874
Buggy source:
@Override public void run(){
  waitForRun();
  LOG.info(String.format("String_Node_Str",topic,partition));
  AvroFileWriter avroFileWriter=new AvroFileWriter(checkpointManager,fileMetaDataManager,fileSystem,logBaseDir,serializer.getAvroSchema(),maxLogFileSizeBytes,syncIntervalBytes,checkpointIntervalMs,inactiveIntervalMs);
  List<List<KafkaLogEvent>> writeLists=Lists.newArrayList();
  try {
    while (isRunning()) {
      int messages=0;
      try {
        if (writeLists.isEmpty()) {
          long processKey=(System.currentTimeMillis() - eventProcessingDelayMs) / eventProcessingDelayMs;
synchronized (messageTable) {
            for (Iterator<Table.Cell<Long,String,List<KafkaLogEvent>>> it=messageTable.cellSet().iterator(); it.hasNext(); ) {
              Table.Cell<Long,String,List<KafkaLogEvent>> cell=it.next();
              if (cell.getRowKey() >= processKey) {
                continue;
              }
              writeLists.add(cell.getValue());
              it.remove();
              messages+=cell.getValue().size();
            }
          }
        }
        if (writeLists.isEmpty()) {
          LOG.info(String.format("String_Node_Str",topic,partition,kafkaEmptySleepMs));
          TimeUnit.MILLISECONDS.sleep(kafkaEmptySleepMs);
        }
        LOG.info(String.format("String_Node_Str",messages,topic,partition));
        for (Iterator<List<KafkaLogEvent>> it=writeLists.iterator(); it.hasNext(); ) {
          avroFileWriter.append(it.next());
          it.remove();
        }
      }
 catch (      Throwable e) {
        LOG.error(String.format("String_Node_Str",topic,partition,kafkaErrorSleepMs),e);
        try {
          TimeUnit.MILLISECONDS.sleep(kafkaErrorSleepMs);
        }
 catch (        InterruptedException e1) {
          LOG.error(String.format("String_Node_Str",topic,partition),e1);
          Thread.currentThread().interrupt();
        }
      }
    }
    LOG.info(String.format("String_Node_Str",topic,partition));
  }
  finally {
    try {
      avroFileWriter.close();
      fileSystem.close();
    }
 catch (    IOException e) {
      LOG.error(String.format("String_Node_Str",topic,partition),e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  waitForRun();
  LOG.info(String.format("String_Node_Str",topic,partition));
  AvroFileWriter avroFileWriter=new AvroFileWriter(checkpointManager,fileMetaDataManager,fileSystem,logBaseDir,serializer.getAvroSchema(),maxLogFileSizeBytes,syncIntervalBytes,checkpointIntervalMs,inactiveIntervalMs);
  List<List<KafkaLogEvent>> writeLists=Lists.newArrayList();
  try {
    while (isRunning()) {
      int messages=0;
      try {
        if (writeLists.isEmpty()) {
          long processKey=(System.currentTimeMillis() - eventProcessingDelayMs) / eventProcessingDelayMs;
synchronized (messageTable) {
            for (Iterator<Table.Cell<Long,String,List<KafkaLogEvent>>> it=messageTable.cellSet().iterator(); it.hasNext(); ) {
              Table.Cell<Long,String,List<KafkaLogEvent>> cell=it.next();
              if (cell.getRowKey() >= processKey) {
                continue;
              }
              writeLists.add(cell.getValue());
              it.remove();
              messages+=cell.getValue().size();
            }
          }
        }
        if (writeLists.isEmpty()) {
          LOG.info(String.format("String_Node_Str",topic,partition,kafkaEmptySleepMs));
          TimeUnit.MILLISECONDS.sleep(kafkaEmptySleepMs);
        }
        LOG.info(String.format("String_Node_Str",messages,topic,partition));
        for (Iterator<List<KafkaLogEvent>> it=writeLists.iterator(); it.hasNext(); ) {
          avroFileWriter.append(it.next());
          it.remove();
        }
      }
 catch (      Throwable e) {
        LOG.error(String.format("String_Node_Str",topic,partition,kafkaErrorSleepMs),e);
        try {
          TimeUnit.MILLISECONDS.sleep(kafkaErrorSleepMs);
        }
 catch (        InterruptedException e1) {
          LOG.error(String.format("String_Node_Str",topic,partition),e1);
          Thread.currentThread().interrupt();
        }
      }
    }
    LOG.info(String.format("String_Node_Str",topic,partition));
  }
  finally {
    try {
      try {
        avroFileWriter.close();
      }
  finally {
        fileSystem.close();
      }
    }
 catch (    IOException e) {
      LOG.error(String.format("String_Node_Str",topic,partition),e);
    }
  }
}