Copilot commented on code in PR #20832:
URL: https://github.com/apache/druid/pull/20832#discussion_r4465570391


##########
server/src/main/java/org/apache/druid/server/QueryLifecycle.java:
##########
@@ -611,4 +613,17 @@ public static boolean shouldLogStackTrace(final Throwable 
e, final QueryContext
       return false;
     }
   }
+
+  /**
+   * Returns whether the exception is an error the user caused and can fix 
themselves, such as invalid SQL or an
+   * unknown table. The client already receives these in the response, and 
they are recorded in the request log and
+   * query metrics, so they don't need a WARN in the server log.
+   *
+   * @param e exception
+   */
+  public static boolean isUserError(final Throwable e)
+  {
+    return e instanceof DruidException
+           && ((DruidException) e).getTargetPersona() == 
DruidException.Persona.USER;

Review Comment:
   `ServerManager#getOrLoadSegmentReferences` creates a `USER`/`TIMEOUT` 
exception when segment-reference acquisition times out, so the persona alone 
does not identify user-caused failures. This predicate downgrades those 
timeouts to DEBUG, hiding failures that may need operator attention at the 
default log level. Exclude `TIMEOUT` from this predicate and add a 
`USER`/`TIMEOUT` regression test.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to