You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/03/10 23:53:58 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #10955: Improve exception handling in IT to reduce excessive stack trace messages

suneet-s commented on a change in pull request #10955:
URL: https://github.com/apache/druid/pull/10955#discussion_r591963997



##########
File path: integration-tests/src/main/java/org/apache/druid/testing/utils/DruidClusterAdminClient.java
##########
@@ -185,7 +187,23 @@ private void waitUntilInstanceReady(final String host)
             return response.getStatus().equals(HttpResponseStatus.OK);
           }
           catch (Throwable e) {
-            LOG.error(e, "");
+            //
+            // supress logging for some specific exceptions to reduce excessive stack trace messages when waiting druid nodes to start up
+            //
+            if (e.getCause() instanceof ChannelException) {
+              Throwable channelException = e.getCause();
+
+              if (channelException.getCause() instanceof ClosedChannelException) {
+                LOG.error("Channel Closed");
+              } else if (!"Channel disconnected".equals(channelException.getMessage())) {
+                // for 'Channel Disconnected', there's no need to log the error message
+                // because the underlying http client has already log this kind of message
+                LOG.error(e, "");
+              }

Review comment:
       I think this is easier to read, and a single line log message shouldn't add too much noise to the logs, but it is still a marker that says the channel disconnected
   
   ```suggestion
                 } else if ("Channel disconnected".equals(channelException.getMessage())) {
                   LOG.error("Channel disconnected: " + e.getMessage());
                 } else {
                     LOG.error(e, "");
                 }
   ```

##########
File path: integration-tests/src/main/java/org/apache/druid/testing/utils/DruidClusterAdminClient.java
##########
@@ -185,7 +187,23 @@ private void waitUntilInstanceReady(final String host)
             return response.getStatus().equals(HttpResponseStatus.OK);
           }
           catch (Throwable e) {
-            LOG.error(e, "");
+            //
+            // supress logging for some specific exceptions to reduce excessive stack trace messages when waiting druid nodes to start up
+            //
+            if (e.getCause() instanceof ChannelException) {
+              Throwable channelException = e.getCause();
+
+              if (channelException.getCause() instanceof ClosedChannelException) {
+                LOG.error("Channel Closed");

Review comment:
       I think we should log the message just incase there is some interesting information in there. `getMessage()` should only be 1 line
   
   ```suggestion
                   LOG.error("Channel Closed " + e.getMessage());
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org