mirror of https://github.com/apache/nifi.git
NIFI-381: Ensure that we always properly account for number of active threads
This commit is contained in:
parent
ca23ad8eaa
commit
1af8c1e22a
|
@ -159,6 +159,7 @@ public class ContinuallyRunProcessorTask implements Callable<Boolean> {
|
||||||
procNode.yield(schedulingAgent.getAdministrativeYieldDuration(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
|
procNode.yield(schedulingAgent.getAdministrativeYieldDuration(TimeUnit.NANOSECONDS), TimeUnit.NANOSECONDS);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
try {
|
||||||
if (batch) {
|
if (batch) {
|
||||||
rawSession.commit();
|
rawSession.commit();
|
||||||
}
|
}
|
||||||
|
@ -174,8 +175,6 @@ public class ContinuallyRunProcessorTask implements Callable<Boolean> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleState.decrementActiveThreadCount();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final StandardFlowFileEvent procEvent = new StandardFlowFileEvent(procNode.getIdentifier());
|
final StandardFlowFileEvent procEvent = new StandardFlowFileEvent(procNode.getIdentifier());
|
||||||
procEvent.setProcessingNanos(processingNanos);
|
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("Unable to update FlowFileEvent Repository for {}; statistics may be inaccurate. Reason for failure: {}", procNode.getProcessor(), e.toString());
|
||||||
logger.error("", e);
|
logger.error("", e);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
scheduleState.decrementActiveThreadCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue