Github user mcgilman commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2276#discussion_r151695374
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
 ---
    @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO 
createProcessorStatusDto(final ProcessorStatus procSta
             dto.setGroupId(procStatus.getGroupId());
             dto.setName(procStatus.getName());
             dto.setStatsLastRefreshed(new Date());
    +        dto.setRunStatus(procStatus.getRunStatus().toString());
    --- End diff --
    
    In addition to setting this here, we need to update it when merging 
responses in a clustered scenario. This merging happens to account for cases 
when a processor is invalid based on an environmental condition. A good example 
of this is a processor configured with a directory where that directory does 
not exist on one node of a cluster. On that node, the processor is invalid, but 
on the others that processor would be considered stopped. In this case, we need 
to ensure the invalid run status takes precedence. You can see an example of 
this here [1].
    
    I think the easiest way to handle this would be to update the runStatus in 
the ProcessorStatusDTO when the method referenced in [1] returns when 
appropriate. Let me know if you have any questions about this.
    
    [1] 
https://github.com/apache/nifi/blob/2da72f15243ef62d47369e8a87cc202a82dbe004/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java#L403


---

Reply via email to