Program: 5360
Project: 5360
Buggy source:
@Override public ProgramController run(final Program program,final ProgramOptions options){
  ApplicationSpecification appSpec=program.getApplicationSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  ProgramType processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == ProgramType.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  final RunId runId=ProgramRunners.getRunId(options);
  if (datasetFramework instanceof ProgramContextAware) {
    ProgramId programId=program.getId();
    ((ProgramContextAware)datasetFramework).initContext(programId.run(runId));
  }
  final List<Closeable> closeables=new ArrayList<>();
  try {
    PluginInstantiator pluginInstantiator=createPluginInstantiator(options,program.getClassLoader());
    if (pluginInstantiator != null) {
      closeables.add(pluginInstantiator);
    }
    WorkflowDriver driver=new WorkflowDriver(program,options,hostname,workflowSpec,programRunnerFactory,metricsCollectionService,datasetFramework,discoveryServiceClient,txClient,runtimeStore,cConf,pluginInstantiator,secureStore,secureStoreManager,messagingService);
    final ProgramController controller=new WorkflowProgramController(program,driver,serviceAnnouncer,runId);
    final String twillRunId=options.getArguments().getOption(ProgramOptionConstants.TWILL_RUN_ID);
    controller.addListener(new AbstractListener(){
      @Override public void init(      ProgramController.State state,      @Nullable Throwable cause){
        long startTimeInSeconds=RunIds.getTime(controller.getRunId(),TimeUnit.SECONDS);
        if (startTimeInSeconds == -1) {
          startTimeInSeconds=TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
        }
        runtimeStore.setStart(program.getId(),runId.getId(),startTimeInSeconds,twillRunId,options.getUserArguments().asMap(),options.getArguments().asMap());
        if (state == ProgramController.State.COMPLETED) {
          completed();
        }
        if (state == ProgramController.State.ERROR) {
          error(controller.getFailureCause());
        }
      }
      @Override public void completed(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        runtimeStore.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.COMPLETED.getRunStatus());
      }
      @Override public void killed(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        runtimeStore.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.KILLED.getRunStatus());
      }
      @Override public void suspended(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        runtimeStore.setSuspend(program.getId(),runId.getId());
      }
      @Override public void resuming(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        runtimeStore.setResume(program.getId(),runId.getId());
      }
      @Override public void error(      Throwable cause){
        LOG.info("String_Node_Str",program.getId(),runId.getId(),cause);
        closeAllQuietly(closeables);
        runtimeStore.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.ERROR.getRunStatus(),new BasicThrowable(cause));
      }
    }
,Threads.SAME_THREAD_EXECUTOR);
    driver.start();
    return controller;
  }
 catch (  Exception e) {
    closeAllQuietly(closeables);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public ProgramController run(final Program program,final ProgramOptions options){
  ApplicationSpecification appSpec=program.getApplicationSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  ProgramType processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == ProgramType.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  final RunId runId=ProgramRunners.getRunId(options);
  if (datasetFramework instanceof ProgramContextAware) {
    ProgramId programId=program.getId();
    ((ProgramContextAware)datasetFramework).initContext(programId.run(runId));
  }
  final List<Closeable> closeables=new ArrayList<>();
  try {
    PluginInstantiator pluginInstantiator=createPluginInstantiator(options,program.getClassLoader());
    if (pluginInstantiator != null) {
      closeables.add(pluginInstantiator);
    }
    WorkflowDriver driver=new WorkflowDriver(program,options,hostname,workflowSpec,programRunnerFactory,metricsCollectionService,datasetFramework,discoveryServiceClient,txClient,runtimeStore,cConf,pluginInstantiator,secureStore,secureStoreManager,messagingService);
    final ProgramController controller=new WorkflowProgramController(program,driver,serviceAnnouncer,runId);
    final String twillRunId=options.getArguments().getOption(ProgramOptionConstants.TWILL_RUN_ID);
    controller.addListener(new AbstractListener(){
      @Override public void init(      ProgramController.State state,      @Nullable Throwable cause){
        long startTimeInSeconds=RunIds.getTime(controller.getRunId(),TimeUnit.SECONDS);
        if (startTimeInSeconds == -1) {
          startTimeInSeconds=TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
        }
        final long finalStartTimeInSeconds=startTimeInSeconds;
        Retries.supplyWithRetries(new Supplier<Void>(){
          @Override public Void get(){
            runtimeStore.setStart(program.getId(),runId.getId(),finalStartTimeInSeconds,twillRunId,options.getUserArguments().asMap(),options.getArguments().asMap());
            return null;
          }
        }
,RetryStrategies.fixDelay(Constants.Retry.RUN_RECORD_UPDATE_RETRY_DELAY_SECS,TimeUnit.SECONDS));
        if (state == ProgramController.State.COMPLETED) {
          completed();
        }
        if (state == ProgramController.State.ERROR) {
          error(controller.getFailureCause());
        }
      }
      @Override public void completed(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        Retries.supplyWithRetries(new Supplier<Void>(){
          @Override public Void get(){
            runtimeStore.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.COMPLETED.getRunStatus());
            return null;
          }
        }
,RetryStrategies.fixDelay(Constants.Retry.RUN_RECORD_UPDATE_RETRY_DELAY_SECS,TimeUnit.SECONDS));
      }
      @Override public void killed(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        Retries.supplyWithRetries(new Supplier<Void>(){
          @Override public Void get(){
            runtimeStore.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.KILLED.getRunStatus());
            return null;
          }
        }
,RetryStrategies.fixDelay(Constants.Retry.RUN_RECORD_UPDATE_RETRY_DELAY_SECS,TimeUnit.SECONDS));
      }
      @Override public void suspended(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        Retries.supplyWithRetries(new Supplier<Void>(){
          @Override public Void get(){
            runtimeStore.setSuspend(program.getId(),runId.getId());
            return null;
          }
        }
,RetryStrategies.fixDelay(Constants.Retry.RUN_RECORD_UPDATE_RETRY_DELAY_SECS,TimeUnit.SECONDS));
      }
      @Override public void resuming(){
        LOG.debug("String_Node_Str",program.getId(),runId.getId());
        Retries.supplyWithRetries(new Supplier<Void>(){
          @Override public Void get(){
            runtimeStore.setResume(program.getId(),runId.getId());
            return null;
          }
        }
,RetryStrategies.fixDelay(Constants.Retry.RUN_RECORD_UPDATE_RETRY_DELAY_SECS,TimeUnit.SECONDS));
      }
      @Override public void error(      final Throwable cause){
        LOG.info("String_Node_Str",program.getId(),runId.getId(),cause);
        closeAllQuietly(closeables);
        Retries.supplyWithRetries(new Supplier<Void>(){
          @Override public Void get(){
            runtimeStore.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.ERROR.getRunStatus(),new BasicThrowable(cause));
            return null;
          }
        }
,RetryStrategies.fixDelay(Constants.Retry.RUN_RECORD_UPDATE_RETRY_DELAY_SECS,TimeUnit.SECONDS));
      }
    }
,Threads.SAME_THREAD_EXECUTOR);
    driver.start();
    return controller;
  }
 catch (  Exception e) {
    closeAllQuietly(closeables);
    throw Throwables.propagate(e);
  }
}