Github user mcgilman commented on the issue:

    https://github.com/apache/nifi/pull/1192
  
    Thanks for the PR @mosermw! I was just running it and had some follow-up 
questions. It looks as though the proposed changes are conditionally validating 
the underlying Processor when it is stopped. However, other validation about 
the Processor (specifically regarding the incoming and outgoing connections) is 
still happening. Comments about these changes are outlined below according to 
the modified method.
    
    **isValid**
    
    isValid is used throughout the application to check processor state usually 
prior to performing some action or transitioning to some state. I believe in 
this method we still need to run all Processor validation logic to ensure we 
know if it's valid when invoking it.
    
    When looking into the context of the isValid usage, it does appear that we 
can make some changes when getting the Processor status [1]. By checking if the 
scheduled state is running prior to checking the processor validity aligns with 
the proposed solution and should help reduce the expense of the status calls 
identified in the JIRA.
    
    **getValidationErrors**
    
    Regardless of whether the UI is rendering the validation results, they are 
still being returned from the Rest Api. I'm wondering if returning a portion of 
the validation errors when the Processor is not stopped is confusing. Would it 
be more clear if we moved the rest of the validation inside of the conditional 
as well? Meaning, when the Processor is not stopped, this method would return 
an empty Collection. When the Processor is stopped, this method would run all 
Processor validation.  
    
    **Additional Comment**
    
    Should these changes also be applied to Ports, Reporting Tasks, and 
Controller Services (if disabled)? I understand that not all of these 
components cause lengthy validation times, but I'm trying to consider it from a 
consistency perspective from a client of the Rest Api. If a Processor only 
returns validation errors when it is stopped, I believe this is how all 
components should work too.
    
    [1] 
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java#L2704


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to