Program: 17269
Project: 17269
Buggy source:
@Override public List<Event> close() throws Exception {
  boolean outputGenerated=this.kvWriter.close();
  DataMovementEventPayloadProto.Builder payloadBuilder=DataMovementEventPayloadProto.newBuilder();
  LOG.info("String_Node_Str" + this.kvWriter.getRawLength() + "String_Node_Str"+ this.kvWriter.getCompressedLength());
  if (dataViaEventsEnabled && outputGenerated && this.kvWriter.getCompressedLength() <= dataViaEventsMaxSize) {
    LOG.info("String_Node_Str" + this.kvWriter.getCompressedLength());
    byte[] data=this.kvWriter.getData();
    DataProto.Builder dataProtoBuilder=DataProto.newBuilder();
    dataProtoBuilder.setData(ByteString.copyFrom(data));
    dataProtoBuilder.setRawLength((int)this.kvWriter.getRawLength());
    dataProtoBuilder.setCompressedLength((int)this.kvWriter.getCompressedLength());
    payloadBuilder.setData(dataProtoBuilder.build());
  }
  String host=getHost();
  ByteBuffer shuffleMetadata=outputContext.getServiceProviderMetaData(ShuffleUtils.SHUFFLE_HANDLER_SERVICE_ID);
  int shufflePort=ShuffleUtils.deserializeShuffleProviderMetaData(shuffleMetadata);
  if (!outputGenerated) {
    LOG.info("String_Node_Str");
    BitSet emptyPartitions=new BitSet();
    emptyPartitions.set(0);
    ByteString emptyPartitionsBytesString=TezUtils.compressByteArrayToByteString(TezUtils.toByteArray(emptyPartitions));
    payloadBuilder.setEmptyPartitions(emptyPartitionsBytesString);
  }
  if (outputGenerated) {
    payloadBuilder.setHost(host);
    payloadBuilder.setPort(shufflePort);
    payloadBuilder.setPathComponent(outputContext.getUniqueIdentifier());
  }
  DataMovementEventPayloadProto payloadProto=payloadBuilder.build();
  DataMovementEvent dmEvent=new DataMovementEvent(0,payloadProto.toByteArray());
  List<Event> events=Lists.newArrayListWithCapacity(1);
  events.add(dmEvent);
  return events;
}

Fixed version (ground truth):
@Override public synchronized List<Event> close() throws Exception {
  boolean outputGenerated=this.kvWriter.close();
  DataMovementEventPayloadProto.Builder payloadBuilder=DataMovementEventPayloadProto.newBuilder();
  LOG.info("String_Node_Str" + this.kvWriter.getRawLength() + "String_Node_Str"+ this.kvWriter.getCompressedLength());
  if (dataViaEventsEnabled && outputGenerated && this.kvWriter.getCompressedLength() <= dataViaEventsMaxSize) {
    LOG.info("String_Node_Str" + this.kvWriter.getCompressedLength());
    byte[] data=this.kvWriter.getData();
    DataProto.Builder dataProtoBuilder=DataProto.newBuilder();
    dataProtoBuilder.setData(ByteString.copyFrom(data));
    dataProtoBuilder.setRawLength((int)this.kvWriter.getRawLength());
    dataProtoBuilder.setCompressedLength((int)this.kvWriter.getCompressedLength());
    payloadBuilder.setData(dataProtoBuilder.build());
  }
  String host=getHost();
  ByteBuffer shuffleMetadata=outputContext.getServiceProviderMetaData(ShuffleUtils.SHUFFLE_HANDLER_SERVICE_ID);
  int shufflePort=ShuffleUtils.deserializeShuffleProviderMetaData(shuffleMetadata);
  if (!outputGenerated) {
    LOG.info("String_Node_Str");
    BitSet emptyPartitions=new BitSet();
    emptyPartitions.set(0);
    ByteString emptyPartitionsBytesString=TezUtils.compressByteArrayToByteString(TezUtils.toByteArray(emptyPartitions));
    payloadBuilder.setEmptyPartitions(emptyPartitionsBytesString);
  }
  if (outputGenerated) {
    payloadBuilder.setHost(host);
    payloadBuilder.setPort(shufflePort);
    payloadBuilder.setPathComponent(outputContext.getUniqueIdentifier());
  }
  DataMovementEventPayloadProto payloadProto=payloadBuilder.build();
  DataMovementEvent dmEvent=new DataMovementEvent(0,payloadProto.toByteArray());
  List<Event> events=Lists.newArrayListWithCapacity(1);
  events.add(dmEvent);
  return events;
}