NIFI-381: Ensure that we always properly account for number of active threads

This commit is contained in:
Mark Payne 2015-02-25 14:07:21 -05:00
parent ca23ad8eaa
commit 1af8c1e22a
1 changed files with 26 additions and 24 deletions

View File

@ -159,6 +159,7 @@ public class ContinuallyRunProcessorTask implements Callable<Boolean> {
procNode.yield(schedulingAgent.getAdministrativeYieldDuration(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
}
} finally {
try {
if (batch) {
rawSession.commit();
}
@ -174,8 +175,6 @@ public class ContinuallyRunProcessorTask implements Callable<Boolean> {
}
}
scheduleState.decrementActiveThreadCount();
try {
final StandardFlowFileEvent procEvent = new StandardFlowFileEvent(procNode.getIdentifier());
procEvent.setProcessingNanos(processingNanos);
@ -185,6 +184,9 @@ public class ContinuallyRunProcessorTask implements Callable<Boolean> {
logger.error("Unable to update FlowFileEvent Repository for {}; statistics may be inaccurate. Reason for failure: {}", procNode.getProcessor(), e.toString());
logger.error("", e);
}
} finally {
scheduleState.decrementActiveThreadCount();
}
}
return false;