ctubbsii commented on code in PR #4879:
URL: https://github.com/apache/accumulo/pull/4879#discussion_r1757476589


##########
server/monitor/src/main/java/org/apache/accumulo/monitor/util/logging/AccumuloMonitorAppender.java:
##########
@@ -122,8 +122,9 @@ public void append(final LogEvent event) {
 
         var req = 
HttpRequest.newBuilder(uri).POST(BodyPublishers.ofString(jsonEvent, UTF_8))
             .setHeader("Content-Type", "application/json").build();
-        @SuppressWarnings("unused")
+
         var future = httpClient.sendAsync(req, BodyHandlers.discarding());
+        future.get();

Review Comment:
   You described this in #4877, but I didn't get it until I saw the code. I 
think this is assuming that if this appender blocks appends, then that will put 
back pressure on the log4j async / lmax disruptor stuff, and we won't have as 
many client threads still doing work sending log messages to the monitor all at 
once from a single process.
   
   This seems like correct reasoning, but I'm not 100% sure.
   
   Implementation-wise, the one-liner version of this would be:
   
   ```suggestion
           httpClient.sendAsync(req, BodyHandlers.discarding()).get();
   ```
   
   Or maybe there's a more efficient method to call on the httpClient. I'm not 
sure.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to