Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-9331

Potential NPE when logging long-running tasks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.15.0
    • Core Framework
    • None

    Description

      In the ThreadUtils class, we have the following code:

      if (monitor.getLockedStackFrame().equals(element))

       However, getLockedStackFrame() can return null, which results in a NPE such as:
      2021-10-24 11:38:17,122 ERROR org.apache.nifi.engine.FlowEngine: Uncaught Exception in Runnable task
      java.lang.NullPointerException: null
      at org.apache.nifi.util.ThreadUtils.createStackTrace(ThreadUtils.java:72)
      at org.apache.nifi.controller.StandardProcessorNode.getActiveThreads(StandardProcessorNode.java:1443)
      at org.apache.nifi.components.monitor.LongRunningTaskMonitor.run(LongRunningTaskMonitor.java:57)
      at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

      Attachments

        Issue Links

          Activity

            People

              exceptionfactory David Handermann
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h