Program: 5598
Project: 5598
Buggy source:
@PUT @Path("String_Node_Str") public HttpContentConsumer write(HttpServiceRequest request,HttpServiceResponder responder,@PathParam("String_Node_Str") String league,@PathParam("String_Node_Str") int season){
  PartitionKey key=PartitionKey.builder().addStringField("String_Node_Str",league).addIntField("String_Node_Str",season).build();
  if (results.getPartition(key) != null) {
    responder.sendString(409,"String_Node_Str",Charsets.UTF_8);
    return null;
  }
  final PartitionOutput output=results.getPartitionOutput(key);
  try {
    final Location partitionDir=output.getLocation();
    if (!partitionDir.mkdirs()) {
      responder.sendString(409,"String_Node_Str",Charsets.UTF_8);
      return null;
    }
    final Location location=partitionDir.append("String_Node_Str");
    final WritableByteChannel channel=Channels.newChannel(location.getOutputStream());
    return new HttpContentConsumer(){
      @Override public void onReceived(      ByteBuffer chunk,      Transactional transactional) throws Exception {
        channel.write(chunk);
      }
      @Override public void onFinish(      HttpServiceResponder responder) throws Exception {
        channel.close();
        output.addPartition();
        responder.sendStatus(200);
      }
      @Override public void onError(      HttpServiceResponder responder,      Throwable failureCause){
        Closeables.closeQuietly(channel);
        try {
          partitionDir.delete(true);
        }
 catch (        IOException e) {
          LOG.warn("String_Node_Str",partitionDir,e);
        }
        LOG.debug("String_Node_Str",location,failureCause);
        responder.sendError(400,String.format("String_Node_Str",location,failureCause.getMessage()));
      }
    }
;
  }
 catch (  IOException e) {
    responder.sendError(400,String.format("String_Node_Str",output.getRelativePath(),e.getMessage()));
    return null;
  }
}

Fixed version (ground truth):
@PUT @Path("String_Node_Str") @TransactionPolicy(TransactionControl.EXPLICIT) public HttpContentConsumer write(HttpServiceRequest request,HttpServiceResponder responder,@PathParam("String_Node_Str") String league,@PathParam("String_Node_Str") int season) throws TransactionFailureException {
  final PartitionKey key=PartitionKey.builder().addStringField("String_Node_Str",league).addIntField("String_Node_Str",season).build();
  final AtomicReference<PartitionDetail> partitionDetail=new AtomicReference<>();
  getContext().execute(new TxRunnable(){
    @Override public void run(    DatasetContext context) throws Exception {
      partitionDetail.set(results.getPartition(key));
    }
  }
);
  if (partitionDetail.get() != null) {
    responder.sendString(409,"String_Node_Str",Charsets.UTF_8);
    return null;
  }
  final PartitionOutput output=results.getPartitionOutput(key);
  try {
    final Location partitionDir=output.getLocation();
    if (!partitionDir.mkdirs()) {
      responder.sendString(409,"String_Node_Str",Charsets.UTF_8);
      return null;
    }
    final Location location=partitionDir.append("String_Node_Str");
    final WritableByteChannel channel=Channels.newChannel(location.getOutputStream());
    return new HttpContentConsumer(){
      @Override public void onReceived(      ByteBuffer chunk,      Transactional transactional) throws Exception {
        channel.write(chunk);
      }
      @Override public void onFinish(      HttpServiceResponder responder) throws Exception {
        channel.close();
        output.addPartition();
        responder.sendStatus(200);
      }
      @Override public void onError(      HttpServiceResponder responder,      Throwable failureCause){
        Closeables.closeQuietly(channel);
        try {
          partitionDir.delete(true);
        }
 catch (        IOException e) {
          LOG.warn("String_Node_Str",partitionDir,e);
        }
        LOG.debug("String_Node_Str",location,failureCause);
        responder.sendError(400,String.format("String_Node_Str",location,failureCause.getMessage()));
      }
    }
;
  }
 catch (  IOException e) {
    responder.sendError(400,String.format("String_Node_Str",output.getRelativePath(),e.getMessage()));
    return null;
  }
}