[
https://issues.apache.org/jira/browse/NIFI-8314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17299799#comment-17299799
]
Mark Payne commented on NIFI-8314:
----------------------------------
Implementation Note: there already exists a class
{{org.apache.nifi.diagnostics.bootstrap.tasks.LongRunningProcessorTask}} that
gets used when a diagnostics dump is produced. The code needed for this will
likely be a single Daemon Thread created in the Flow Controller that will sleep
for 5 mintues, then perform something like this, where we find any long-running
tasks. It might make sense to introduce a `logLongRunningTasks` method in
ProcessorNode itself, or the information could be captured and then logged by
another class. There should also be a bulletin, ideally using the processor's
logger.
We should, however, avoid using the Timer-Driven Thread Pool to schedule the
task to run periodically. This is because the processors themselves use this,
and if there is ever a situation in which all the threads get used up and are
not getting released, we want a separate thread outside of that thread pool to
still run and produce these warnings.
> Generate warning for any long-running tasks
> -------------------------------------------
>
> Key: NIFI-8314
> URL: https://issues.apache.org/jira/browse/NIFI-8314
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework
> Reporter: Mark Payne
> Priority: Major
>
> NiFi keeps track of how long any particular call to {{onTrigger}} is taking.
> We should periodically (perhaps every minute) check for any long-running
> task. If any task has been running more than 5 minutes (or some configurable
> value), we should log a WARN message with the stack trace for that particular
> thread, and we should generate a bulletin indicating that the processor has
> been running for a while.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)