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

    https://github.com/apache/nifi/pull/1585#discussion_r106502862
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
 ---
    @@ -857,7 +858,13 @@ public Relationship getRelationship(final String 
relationshipName) {
     
         @Override
         public Processor getProcessor() {
    -        return this.processor;
    +        return processorRef.get().getProcessor();
    +    }
    +
    +    @Override
    +    public void setProcessor(final LoggableComponent<Processor> processor) 
{
    +        final ProcessorDetails processorDetails = new 
ProcessorDetails(processor);
    --- End diff --
    
    We should probably have some thread protection here to make sure that the 
Processor is indeed stopped. This would mean that we need to enter a 
synchronized block here, then verify that the processor is not running 
(!isRunning()) and then do the processorRef.set(processorDetails). We would 
also need to ensure that in the start() method that the act of changing the 
scheduledState from STOPPED to STARTED is also synchronized to ensure atomicity.


---
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