Program: 6888
Project: 6888
Buggy source:
private void executeAction(ApplicationSpecification appSpec,WorkflowActionNode node,InstantiatorFactory instantiator,ClassLoader classLoader,WorkflowToken token) throws Exception {
  final WorkflowActionSpecification actionSpec;
  ScheduleProgramInfo actionInfo=node.getProgram();
switch (actionInfo.getProgramType()) {
case MAPREDUCE:
    MapReduceSpecification mapReduceSpec=appSpec.getMapReduce().get(actionInfo.getProgramName());
  String mapReduce=mapReduceSpec.getName();
actionSpec=new DefaultWorkflowActionSpecification(new ProgramWorkflowAction(mapReduce,mapReduce,SchedulableProgramType.MAPREDUCE));
break;
case SPARK:
SparkSpecification sparkSpec=appSpec.getSpark().get(actionInfo.getProgramName());
String spark=sparkSpec.getName();
actionSpec=new DefaultWorkflowActionSpecification(new ProgramWorkflowAction(spark,spark,SchedulableProgramType.SPARK));
break;
case CUSTOM_ACTION:
actionSpec=node.getActionSpecification();
break;
default :
LOG.error("String_Node_Str",actionInfo.getProgramType(),actionInfo.getProgramName());
throw new IllegalStateException("String_Node_Str");
}
status.put(node.getNodeId(),node);
final WorkflowAction action=initialize(actionSpec,classLoader,instantiator,token,node.getNodeId());
ExecutorService executor=Executors.newSingleThreadExecutor();
try {
Future<?> future=executor.submit(new Runnable(){
@Override public void run(){
ClassLoaders.setContextClassLoader(action.getClass().getClassLoader());
try {
action.run();
}
  finally {
destroy(actionSpec,action);
}
}
}
);
future.get();
}
 catch (Throwable t) {
LOG.error("String_Node_Str",actionSpec);
Throwables.propagateIfPossible(t,Exception.class);
throw Throwables.propagate(t);
}
 finally {
executor.shutdownNow();
status.remove(node.getNodeId());
}
}

Fixed version (ground truth):
private void executeAction(ApplicationSpecification appSpec,WorkflowActionNode node,InstantiatorFactory instantiator,ClassLoader classLoader,WorkflowToken token) throws Exception {
  final WorkflowActionSpecification actionSpec;
  ScheduleProgramInfo actionInfo=node.getProgram();
switch (actionInfo.getProgramType()) {
case MAPREDUCE:
    MapReduceSpecification mapReduceSpec=appSpec.getMapReduce().get(actionInfo.getProgramName());
  String mapReduce=mapReduceSpec.getName();
actionSpec=new DefaultWorkflowActionSpecification(new ProgramWorkflowAction(mapReduce,mapReduce,SchedulableProgramType.MAPREDUCE));
break;
case SPARK:
SparkSpecification sparkSpec=appSpec.getSpark().get(actionInfo.getProgramName());
String spark=sparkSpec.getName();
actionSpec=new DefaultWorkflowActionSpecification(new ProgramWorkflowAction(spark,spark,SchedulableProgramType.SPARK));
break;
case CUSTOM_ACTION:
actionSpec=node.getActionSpecification();
break;
default :
LOG.error("String_Node_Str",actionInfo.getProgramType(),actionInfo.getProgramName());
throw new IllegalStateException("String_Node_Str");
}
status.put(node.getNodeId(),node);
final WorkflowAction action=initialize(actionSpec,classLoader,instantiator,token,node.getNodeId());
ExecutorService executor=Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("String_Node_Str").build());
try {
Future<?> future=executor.submit(new Runnable(){
@Override public void run(){
ClassLoaders.setContextClassLoader(action.getClass().getClassLoader());
try {
action.run();
}
  finally {
destroy(actionSpec,action);
}
}
}
);
future.get();
}
 catch (Throwable t) {
LOG.error("String_Node_Str",actionSpec);
Throwables.propagateIfPossible(t,Exception.class);
throw Throwables.propagate(t);
}
 finally {
executor.shutdownNow();
status.remove(node.getNodeId());
}
}