ptupitsyn commented on code in PR #7481:
URL: https://github.com/apache/ignite-3/pull/7481#discussion_r2736619555


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -750,17 +788,21 @@ private void writeErrorCore(Throwable err, 
ClientMessagePacker packer) {
         }
     }
 
-    private static boolean shouldLogError(Throwable e) {
+    static boolean shouldLogError(Throwable e) {
         Throwable cause = ExceptionUtils.unwrapRootCause(e);
 
-        // Do not log errors caused by cancellation (triggered by user action).
         if (cause instanceof TraceableException) {
             TraceableException te = (TraceableException) cause;
             int c = te.code();
 
-            return c != Sql.EXECUTION_CANCELLED_ERR
-                    && c != Compute.COMPUTE_JOB_CANCELLED_ERR
-                    && c != Compute.CANCELLING_ERR;
+            if (c == Sql.EXECUTION_CANCELLED_ERR
+                    || c == Compute.CANCELLING_ERR
+                    || c == Compute.COMPUTE_JOB_CANCELLED_ERR) {
+                // Do not log errors caused by cancellation (triggered by user 
action).
+                return false;
+            } else {
+                return ERROR_CODES_TO_LOG.contains(c);
+            }

Review Comment:
   I would revert this part. Essentially it allows only codes from 
`ERROR_CODES_TO_LOG` to be logged, which is not correct. Any unexpected 
exception should be logged.
   
   In other words, we should have a black list, not a white list.



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