markap14 commented on a change in pull request #4983:
URL: https://github.com/apache/nifi/pull/4983#discussion_r610012031



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/replication/okhttp/OkHttpReplicationClient.java
##########
@@ -317,6 +318,7 @@ private OkHttpClient createOkHttpClient(final 
NiFiProperties properties) {
         okHttpClientBuilder.followRedirects(true);
         final int connectionPoolSize = 
properties.getClusterNodeMaxConcurrentRequests();
         okHttpClientBuilder.connectionPool(new 
ConnectionPool(connectionPoolSize, 5, TimeUnit.MINUTES));
+        okHttpClientBuilder.eventListener(new 
RequestReplicationEventListener());

Review comment:
       I took a look at the LoggingEventListener, but it logs each individual 
event individually, and since we're always replicating to each node in the 
cluster, that becomes really difficult to partition out and understand, either 
programmatically or manually.
   
   I did also consider using a mechanism to avoid the expensive of doing this 
if logging is not enabled. But since this is done only when we replicate 
requests across the cluster, that's not terribly frequently and so the overhead 
is almost nil. We could, in the future, improve it,  by checking 
isDebugEnabled() but I didn't want to cloud the code at this point, given the 
(little) expense of the operation and how infrequently it's performed. Plus, I 
can envision improving this in the future to do something like always warn if 
DNS lookup takes more than 1 second or something like that, even if debug 
logging is not enabled.




-- 
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:
[email protected]


Reply via email to