FrankChen021 commented on code in PR #20183:
URL: https://github.com/apache/druid/pull/20183#discussion_r4271802285


##########
server/src/main/java/org/apache/druid/server/QueryLifecycle.java:
##########
@@ -420,13 +460,49 @@ public <T> QueryResponse<T> execute()
     final ResponseContext responseContext = 
DirectDruidClient.makeResponseContextForQuery();
 
     @SuppressWarnings("unchecked")
-    final Sequence<T> res = QueryPlus.wrap((Query<T>) baseQuery)
-                                     
.withIdentity(authenticationResult.getIdentity())
-                                     .run(texasRanger, responseContext);
+    final Query<T> query = (Query<T>) baseQuery;
+    final DataSourceQueryHandler dataSourceQueryHandler = 
findDataSourceQueryHandler(query.getDataSource());
+    final QueryRunner<T> queryRunner = dataSourceQueryHandler == null
+                                       ? query.getRunner(texasRanger)
+                                       : dataSourceQueryHandler.createRunner(

Review Comment:
   [P1] Preserve server timeout enforcement for handler-backed queries
   
   **Finding:** Handler-backed queries skip the normal 
SetAndVerifyContextQueryRunner path, which applies ServerConfig default and 
maximum timeouts and writes DirectDruidClient.QUERY_FAIL_TIME. The system-table 
handlers instead derive deadlines from the raw query context: omitted timeouts 
use the query-context fallback rather than 
druid.server.http.defaultQueryTimeout, timeout: 0 becomes JodaUtils.MAX_INSTANT 
instead of the server maximum, and values above maxQueryTimeout are not 
rejected. Since node fanout begins before the later normal walker call, a 
stalled node request can outlive or bypass the configured query deadline.
   
   **Suggestion:** Normalize handler-backed queries with the same server 
timeout/max-timeout policy before invoking the handler, and pass the normalized 
deadline into both local and fanout execution paths.



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