NIFI-15519 - Skip flow save during shutdown to preserve processor auto-resume states#10864
Merged
exceptionfactory merged 3 commits intoapache:mainfrom Feb 6, 2026
Merged
NIFI-15519 - Skip flow save during shutdown to preserve processor auto-resume states#10864exceptionfactory merged 3 commits intoapache:mainfrom
exceptionfactory merged 3 commits intoapache:mainfrom
Conversation
exceptionfactory
approved these changes
Feb 6, 2026
Contributor
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for tracking this down @pvillard31, the adjustments to the save process on shutdown make sense, and the additional test is helpful. +1 merging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NIFI-15519 - Skip flow save during shutdown to preserve processor auto-resume states
OK, thanks to the reporter and the data shared with me, I was able to track down the issue. At a high level, during graceful shutdown,
SaveReportingTaskcan execute afterFlowController.shutdown()has already set all processors' desired state toSTOPPED.If this happens,
VersionedDataflowMappermaps theSTOPPEDstate toENABLEDinflow.json.gz. On the next startup,VersionedFlowSynchronizerreadsENABLED(notRUNNING) and does not add the processors tostartConnectablesAfterInitialization, soonFlowInitialized()starts zero components.This is a race condition: the
SaveReportingTaskruns on a scheduled executor every 500ms and also runs explicitly at the end ofStandardFlowService.stop(). If a save request (saveHolder) is pending when shutdown begins, the save executes after processors are stopped, overwriting the previously savedRUNNINGstates withENABLED.The issue might happen more frequently when using flow registry versioning which triggers frequent background
saveFlowChanges()calls, making it highly likely that a save is pending at shutdown time.The system test easily reproduces the issue and the test would fail without the fix.
Tracking
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