NIFI-12992 Reset Validation State when Updating Process Group Execution Engine (#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 <exceptionfactory@apache.org>
This commit is contained in:
Mark Payne 2024-09-25 17:19:46 -04:00 committed by GitHub
parent 2e7a39d200
commit e9ce40d209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -4348,6 +4348,8 @@ public final class StandardProcessGroup implements ProcessGroup {
try {
verifyCanSetExecutionEngine(executionEngine);
this.executionEngine = executionEngine;
findAllProcessors().forEach(ProcessorNode::resetValidationState);
findAllControllerServices().forEach(ControllerServiceNode::resetValidationState);
} finally {
writeLock.unlock();
}

View File

@ -1387,6 +1387,11 @@ public abstract class AbstractComponentNode implements ComponentNode {
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()));