Skip to content

Commit

Permalink
NIFI-12992 Reset Validation State when Updating Process Group Executi…
Browse files Browse the repository at this point in the history
…on Engine (apache#9187)

- Do not reset validation status for a component if it is not in a state where validation will be performed

Signed-off-by: David Handermann <[email protected]>
  • Loading branch information
markap14 authored Sep 25, 2024
1 parent 2e7a39d commit e9ce40d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4348,6 +4348,8 @@ public void setExecutionEngine(final ExecutionEngine executionEngine) {
try {
verifyCanSetExecutionEngine(executionEngine);
this.executionEngine = executionEngine;
findAllProcessors().forEach(ProcessorNode::resetValidationState);
findAllControllerServices().forEach(ControllerServiceNode::resetValidationState);
} finally {
writeLock.unlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,11 @@ private boolean replaceValidationState(final ValidationState expectedState, fina
public void resetValidationState() {
lock.lock();
try {
if (!isValidationNecessary()) {
logger.debug("Triggered to reset validation state of {} but will leave validation state as {} because validation is not necessary in its current state", this, validationState.get());
return;
}

validationContext = null;
validationState.set(new ValidationState(ValidationStatus.VALIDATING, Collections.emptyList()));

Expand Down

0 comments on commit e9ce40d

Please sign in to comment.