jtuglu1 commented on code in PR #19393:
URL: https://github.com/apache/druid/pull/19393#discussion_r3174125073


##########
server/src/main/java/org/apache/druid/server/SetAndVerifyContextQueryRunner.java:
##########
@@ -70,13 +70,19 @@ public Query<T> 
withTimeoutAndMaxScatterGatherBytes(Query<T> query, ServerConfig
     );
     // DirectDruidClient.QUERY_FAIL_TIME is used by DirectDruidClient and 
JsonParserIterator to determine when to
     // fail with a timeout exception
-    final long failTime;
     final QueryContext context = newQuery.context();
+    final long existingFailTime = 
context.getLong(DirectDruidClient.QUERY_FAIL_TIME, -1L);
+    final long computedFailTime;
     if (context.hasTimeout()) {
-      failTime = this.startTimeMillis + context.getTimeout();
+      computedFailTime = this.startTimeMillis + context.getTimeout();
     } else {
-      failTime = this.startTimeMillis + serverConfig.getMaxQueryTimeout();
+      computedFailTime = this.startTimeMillis + 
serverConfig.getMaxQueryTimeout();

Review Comment:
   Yep – added an overflow check + 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