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

    https://github.com/apache/nifi/pull/2634#discussion_r181735366
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ConnectableTask.java
 ---
    @@ -103,8 +104,24 @@ private boolean isYielded() {
             return connectable.getYieldExpiration() > 
System.currentTimeMillis();
         }
     
    +    /**
    +     * Make sure processor has work to do. This means that it meets one of 
these criteria:
    +     * <ol>
    +     * <li>It is annotated with @TriggerWhenEmpty</li>
    +     * <li>It has no incoming connections</li>
    +     * <li>All incoming connections are self-loops</li>
    +     * <li>It has data in an incoming Connection
    +     *     AND It is not a Funnel without outgoing connections
    +     * </li>
    +     * </ol>
    +     * @return true if there is work to do, otherwise false
    +     */
         private boolean isWorkToDo() {
    -        return connectable.isTriggerWhenEmpty() || 
!connectable.hasIncomingConnection() || !hasNonLoopConnection || 
Connectables.flowFilesQueued(connectable);
    +        return connectable.isTriggerWhenEmpty()
    +                || !connectable.hasIncomingConnection()
    --- End diff --
    
    This logic seems inverted unnecessarily. Why is 
'connectable.hasIncomingConnection()' negated? This leads to the method 
returning true when there are no incoming connections. Similarly, is it the 
intent to indicate no work to do if the only incoming connections are looped 
connections?


---

Reply via email to