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

    https://github.com/apache/nifi/pull/2337#discussion_r156955954
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java
 ---
    @@ -1533,13 +1533,11 @@ public FlowFile get() {
                 return Collections.emptyList();
             }
     
    -        final Connection connection = 
connections.get(context.getNextIncomingConnectionIndex() % connections.size());
    -
    -        return get(connection, new ConnectionPoller() {
    +        return get(new ConnectionPoller() {
                 @Override
                 public List<FlowFileRecord> poll(final Connection connection, 
final Set<FlowFileRecord> expiredRecords) {
                     return connection.poll(new FlowFileFilter() {
    -                    int polled = 0;
    +                    volatile int polled = 0;
    --- End diff --
    
    We don't need this to be volatile. The variable is not shared between 
multiple threads and is not operated on atomically (i.e., we use ++polled, 
which is not atomic for volatile variables).


---

Reply via email to