[
https://issues.apache.org/jira/browse/NIFI-11681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17732082#comment-17732082
]
ASF subversion and git services commented on NIFI-11681:
--------------------------------------------------------
Commit 787e0d82614e345b5afbef6691c418c43cf0ab08 in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=787e0d8261 ]
NIFI-11681: Terminate Process Sessions before interrupting processor threads
This closes #7371
Signed-off-by: David Handermann <[email protected]>
> 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
> Priority: Minor
> Fix For: 1.latest, 2.latest
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)