Program: 8073
Project: 8073
Buggy source:
@Override protected void run(){
  LoggingContextAccessor.setLoggingContext(loggingContext);
  initFlowlet();
  PriorityBlockingQueue<ProcessEntry> processQueue=new PriorityBlockingQueue<ProcessEntry>(processSpecs.size());
  for (  ProcessSpecification spec : processSpecs) {
    processQueue.offer(new ProcessEntry(spec));
  }
  List<ProcessEntry> processList=Lists.newArrayListWithExpectedSize(processSpecs.size() * 2);
  while (isRunning()) {
    CountDownLatch suspendLatch=suspension.get();
    if (suspendLatch != null) {
      try {
        while (inflight.get() != 0) {
          TimeUnit.MILLISECONDS.sleep(10);
        }
        suspendBarrier.await();
        suspendLatch.await();
      }
 catch (      Exception e) {
        continue;
      }
    }
    try {
      processQueue.peek().await();
    }
 catch (    InterruptedException e) {
      continue;
    }
    processList.clear();
    processQueue.drainTo(processList);
    for (    ProcessEntry entry : processList) {
      try {
        if (!entry.shouldProcess()) {
          continue;
        }
        ProcessMethod processMethod=entry.processSpec.getProcessMethod();
        if (processMethod.needsInput()) {
          flowletContext.getSystemMetrics().meter(FlowletProcessDriver.class,"String_Node_Str",1);
        }
        InputDatum input=entry.processSpec.getQueueReader().dequeue();
        if (!input.needProcess()) {
          entry.backOff();
          continue;
        }
        if (processMethod.needsInput()) {
          flowletContext.getSystemMetrics().meter(FlowletProcessDriver.class,"String_Node_Str",1);
        }
        entry.nextDeque=0;
        inflight.getAndIncrement();
        try {
          processMethod.invoke(input).commit(transactionExecutor,processMethodCallback(processQueue,entry,input));
        }
 catch (        Throwable t) {
          LOG.error(String.format("String_Node_Str",entry.processSpec,flowletContext),t);
        }
      }
 catch (      OperationException e) {
        LOG.error("String_Node_Str" + flowletContext,e);
      }
 finally {
        if (!entry.isRetry()) {
          processQueue.offer(entry);
        }
      }
    }
  }
  destroyFlowlet();
}

Fixed version (ground truth):
@Override protected void run(){
  LoggingContextAccessor.setLoggingContext(loggingContext);
  initFlowlet();
  PriorityBlockingQueue<ProcessEntry> processQueue=new PriorityBlockingQueue<ProcessEntry>(processSpecs.size());
  for (  ProcessSpecification spec : processSpecs) {
    processQueue.offer(new ProcessEntry(spec));
  }
  List<ProcessEntry> processList=Lists.newArrayListWithExpectedSize(processSpecs.size() * 2);
  while (isRunning()) {
    CountDownLatch suspendLatch=suspension.get();
    if (suspendLatch != null) {
      try {
        while (inflight.get() != 0) {
          TimeUnit.MILLISECONDS.sleep(10);
        }
        suspendBarrier.await();
        suspendLatch.await();
      }
 catch (      Exception e) {
        continue;
      }
    }
    try {
      processQueue.peek().await();
    }
 catch (    InterruptedException e) {
      continue;
    }
    processList.clear();
    processQueue.drainTo(processList);
    for (    ProcessEntry entry : processList) {
      boolean invoked=false;
      try {
        if (!entry.shouldProcess()) {
          continue;
        }
        ProcessMethod processMethod=entry.getProcessSpec().getProcessMethod();
        if (processMethod.needsInput()) {
          flowletContext.getSystemMetrics().meter(FlowletProcessDriver.class,"String_Node_Str",1);
        }
        InputDatum input=entry.getProcessSpec().getQueueReader().dequeue();
        if (!input.needProcess()) {
          entry.backOff();
          continue;
        }
        if (processMethod.needsInput()) {
          flowletContext.getSystemMetrics().meter(FlowletProcessDriver.class,"String_Node_Str",1);
        }
        entry.nextDeque=0;
        inflight.getAndIncrement();
        try {
          invoked=true;
          processMethod.invoke(input).commit(transactionExecutor,processMethodCallback(processQueue,entry,input));
        }
 catch (        Throwable t) {
          LOG.error(String.format("String_Node_Str",entry.getProcessSpec(),flowletContext),t);
        }
      }
 catch (      OperationException e) {
        LOG.error("String_Node_Str" + flowletContext,e);
      }
 finally {
        if (!invoked || (flowletContext.isAsyncMode() && !entry.isRetry())) {
          processQueue.offer(entry);
        }
      }
    }
  }
  destroyFlowlet();
}