You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Mark Payne (Jira)" <ji...@apache.org> on 2023/06/12 20:56:00 UTC

[jira] [Created] (NIFI-11681) When Processor is Terminated, the thread is interrupted before the ProcessSession is terminated

Mark Payne created NIFI-11681:
---------------------------------

             Summary: When Processor is Terminated, the thread is interrupted before the ProcessSession is terminated
                 Key: NIFI-11681
                 URL: https://issues.apache.org/jira/browse/NIFI-11681
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core Framework
            Reporter: Mark Payne
            Assignee: Mark Payne
             Fix For: 1.latest, 2.latest


When a Processor is Terminated, we notify the session that it is terminated. This rolls back the session and causes any subsequent calls into the session or its InputStream / OutputStream to throw a TerminatedTaskException.

Additionally, it interrupts any active threads in the Processor.

However, it does these in the opposite order. It interrupts the Processor thread first.

As a result, it can interrupt the Processor thread, which allows the Processor to continue on and call into the Process Session, before the Process Session is terminated.

This can cause the interrupted thread to transfer FlowFiles, etc. after being interrupted.

This is the cause of the frequent failures that we've seen in the  DynamicClassPathModificationIT system test: {{DynamicClassPathModificationIT.testSuccessAfterTerminate » Timeout testSuccessAfterTerminate() timed out after 5 minutes}}

We need to mark the session as terminated before interrupting the thread, so that any calls into the session will fail after interrupting the processor's threads.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)