[ 
https://issues.apache.org/jira/browse/NIFI-4864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16366073#comment-16366073
 ] 

ASF GitHub Bot commented on NIFI-4864:
--------------------------------------

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

    https://github.com/apache/nifi/pull/2470#discussion_r168568930
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
 ---
    @@ -3447,11 +3448,32 @@ public void startReportingTask(final 
ReportingTaskNode reportingTaskNode) {
             if (isTerminated()) {
                 throw new IllegalStateException("Cannot start reporting task " 
+ reportingTaskNode.getIdentifier() + " because the controller is terminated");
             }
    -
    +        validateAdditionalResourcesFingerprint(reportingTaskNode);
             reportingTaskNode.verifyCanStart();
             processScheduler.schedule(reportingTaskNode);
         }
     
    +    private void validateAdditionalResourcesFingerprint(ReportingTaskNode 
reportingTaskNode){
    --- End diff --
    
    It seems like this method is very similar to the code needed in the 
controller service provider and the standard process group... since all three 
node types extend from AbstractConfiguredComponent, would it be possible to 
create a single method there like `void reloadIfNecessary()` (or some better 
name) ? 
    
    The logic for calculating the fingerprint, comparing to the existing one, 
and reloading if different should all be able to implemented generically for 
any AbstractConfiguredComponent since the existing fingerprint is already 
stored there.


> Additional Resources property pointing at a directory won't find new JARs
> -------------------------------------------------------------------------
>
>                 Key: NIFI-4864
>                 URL: https://issues.apache.org/jira/browse/NIFI-4864
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.2.0, 1.3.0, 1.4.0, 1.5.0
>            Reporter: Bryan Bende
>            Assignee: zenfenan
>            Priority: Minor
>
> If you have a processor/Controller Service/Reporting Task that has a property 
> with dynamicallyModifiesClasspath(true) and you set the value to a directory, 
> the resources in that directory will only be calculated when that property 
> changes. This means if you added JARs to the directory later, and stopped and 
> started your processor, those new JARs still won't be available. You would 
> have to change the property to a new directory, or back and forth to some 
> other directory, to force a recalculation.
> The setProperties method in AbstractConfiguredComponent is where it looks at 
> incoming property changes and determines if any were for classpath related 
> properties and then calls reload accordingly.
> We would need to consider the case where setProperties is never even being 
> called, someone just stops and starts the processor and would want to pick up 
> any new JARs added.
> A possible solution might be to computer some kind of hash/fingerprint of the 
> URLs each time reload is called, and then when starting the processor we 
> could recompute the fingerprint and compare it to the previous one. If they 
> are different then we call reload before starting the component.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to