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

    https://github.com/apache/nifi/pull/71#discussion_r35453740
  
    --- Diff: 
nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnAttribute.java
 ---
    @@ -166,6 +170,27 @@ public void onPropertyModified(final 
PropertyDescriptor descriptor, final String
             this.relationships.set(newRelationships);
         }
     
    +    /**
    +     * When this processor is 
    +     * @param context
    +     */
    +    @OnScheduled
    +    public void onScheduled(final ProcessContext context) {
    +        for (final PropertyDescriptor descriptor : 
context.getProperties().keySet()) {
    +            if (!descriptor.isDynamic()) {
    +                continue;
    +            }
    +            getLogger().debug("Adding new dynamic property: {}", new 
Object[]{descriptor});
    +            propertyMap.put(new 
Relationship.Builder().name(descriptor.getName()).build(), 
context.getProperty(descriptor));
    +        }
    +    }
    +    
    +    @OnUnscheduled
    --- End diff --
    
    Can we changed this to @OnStopped? As it is right now, we have a race 
condition - map could get cleared just after a thread enters onTrigger, which 
would result in it running with an empty map


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to