NIFI-15449 - NAR deletion blocks indefinitely when Python processor is initializing#10753
NIFI-15449 - NAR deletion blocks indefinitely when Python processor is initializing#10753exceptionfactory merged 3 commits intoapache:mainfrom
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for working on this issue @pvillard31. The general strategy looks good. I noted a few initial recommendations. I also recommend reviewing most of the new log and exception messages to include a relevant detail, such as the Process ID or component ID where applicable.
|
Thanks for the review @exceptionfactory - pushed a commit to address your comments |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for the initial updates @pvillard31. On review, the overall approach looks good, but I noted quite a few logs and comments that seemed too verbose and not useful. After cleaning these up, this should be ready to go forward.
cc32d39 to
f5292e5
Compare
|
Thanks for the extensive review @exceptionfactory, I really appreciate it. I did add a lot of logs and comments in the code while I was debugging the issue and figuring out the deadlock especially as it was the first time for me to really dig into this part of the code. I just pushed a commit to clean up everything. Thanks again. |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for working through the feedback @pvillard31, the latest version looks good! +1 merging
…ssor is initializing (apache#10753) Signed-off-by: David Handermann <exceptionfactory@apache.org>
Summary
NIFI-15449 - NAR deletion blocks indefinitely when Python processor is initializing
The issue is caused by:
StandardPythonBridgeandStandardExtensionDiscoveringManager:StandardExtensionDiscoveringManagerlock -> waits forStandardPythonBridgelockStandardPythonBridgelock -> callsgetNarDirectories()which waits forStandardExtensionDiscoveringManagerlockChanges:
StandardPythonBridgesynchronized block, ensuring locks are always acquired in a consistent order.isShutdown()checks during venv creation and dependency installation loops in PythonProcessCANCELLEDstate toAsyncLoadedProcessor.LoadStateand acancelLoading()methodStandardPythonProcessorBridgethat sets a flag checked during initializationstart()is called) so they can be properly shut down during NAR deletionTracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation