[ 
https://issues.apache.org/jira/browse/NIFI-14663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17979296#comment-17979296
 ] 

ASF subversion and git services commented on NIFI-14663:
--------------------------------------------------------

Commit f04a3adc7eb9fe2472c193686ebf4e9ba1fa24d6 in nifi's branch 
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=f04a3adc7e ]

NIFI-14663: Fixed threading issue in which ProcessorNode.isRunning() can return 
false before shutdown lifecycle methods have been run
Fixed bug in System Test, in which test was not waiting for Controller Service 
to become valid before starting Processor that references it. Also fixed a typo 
in NiFiClientUtil in which waitForControllerServicesEnabled was misspelled as 
waitForControllerSerivcesEnabled


> Threading bug can allow Processor to report that it is stopped before it 
> truly is
> ---------------------------------------------------------------------------------
>
>                 Key: NIFI-14663
>                 URL: https://issues.apache.org/jira/browse/NIFI-14663
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>
> In order to determine if a Processor is fully stopped, we must do 2 things: 
> We must check that the state is STOPPED and we must also check that there are 
> no active threads.
> However, when ProcessorNode.stop() is called, it transitions the state from 
> RUNNING to STOPPING (STOPPING is an "internal-only" state that is never 
> exposed outside of the ProcessorNode class) and then immediately increment 
> the Active Thread Count (unless there are no lifecycle methods to call).
> This can result in a Processor being stopped, which transitions its internal 
> state to STOPPING and then ProcessorNode.isRunning() will return false. 
> Immediately afterward, the Active Thread count can be incremented to 1 in 
> order to call @OnUnscheduled methods, and ProcessorNode.isRunning() will 
> return true - even though it hasn't been restated.
> This has been observed in a failure of 
> FlowSynchronizationTestIT.testAddControllerServiceReferencingExistingService()



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

Reply via email to