arpadboda commented on a change in pull request #3647: NIFI-6530 - HTTP 
SiteToSite server returns 201 in case no data is ava…
URL: https://github.com/apache/nifi/pull/3647#discussion_r314233124
 
 

 ##########
 File path: 
nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/http/HttpClient.java
 ##########
 @@ -168,6 +169,9 @@ public Transaction createTransaction(final 
TransferDirection direction) throws H
             try {
                 transactionUrl = apiClient.initiateTransaction(direction, 
portId);
                 commSession.setUserDn(apiClient.getTrustedPeerDn());
+            } catch (final NoContentException e) {
+                logger.debug("Peer {} has no flowfiles to provide", peer);
+                throw e;
 
 Review comment:
   I partly agree. Checking all the nodes is a fair point, although transaction 
== null is considered as an error case:
   ```
           if (transaction == null) {
               logger.debug("{} Unable to create transaction to communicate 
with; all peers must be penalized, so yielding context", this);
               session.rollback();
               context.yield();
               return;
           }
   ```
   Neither the comment here, nor the rollback should apply in case peers has no 
data to provide. We should simply yield. 
   
   Edit: my main concern here is mixing the case of having no valid (or having 
only penalised) peers with the case of simply having nothing to transfer. The 
first I consider as an error, the 2nd is a regular usecase. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to