This is an automated email from the ASF dual-hosted git repository.

abhishekrb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 582d61c9253 feat: log total bytes gathered when max scatter-gather 
bytes limit is reached (#18841)
582d61c9253 is described below

commit 582d61c9253a709563301c7182785444b85f36eb
Author: TessaIO <[email protected]>
AuthorDate: Wed Dec 17 16:14:07 2025 +0100

    feat: log total bytes gathered when max scatter-gather bytes limit is 
reached (#18841)
    
    Include total bytes gathered in the exception when max scatter-gather bytes 
limit is reached
    
    Signed-off-by: TessaIO <[email protected]>
---
 .../src/main/java/org/apache/druid/client/DirectDruidClient.java | 9 ++++++---
 .../druid/query/QueryRunnerBasedOnClusteredClientTestBase.java   | 5 +----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/server/src/main/java/org/apache/druid/client/DirectDruidClient.java 
b/server/src/main/java/org/apache/druid/client/DirectDruidClient.java
index ce79ad7140d..ec4ab6f289a 100644
--- a/server/src/main/java/org/apache/druid/client/DirectDruidClient.java
+++ b/server/src/main/java/org/apache/druid/client/DirectDruidClient.java
@@ -437,11 +437,14 @@ public class DirectDruidClient<T> implements 
QueryRunner<T>
 
         private void checkTotalBytesLimit(long bytes)
         {
-          if (maxScatterGatherBytes < Long.MAX_VALUE && 
totalBytesGathered.addAndGet(bytes) > maxScatterGatherBytes) {
+          final long currentTotalBytesGathered = 
totalBytesGathered.addAndGet(bytes);
+          if (currentTotalBytesGathered > maxScatterGatherBytes) {
             String msg = StringUtils.format(
-                "Query[%s] url[%s] max scatter-gather bytes limit reached.",
+                "Query[%s] url[%s] total bytes gathered[%,d] exceeds 
maxScatterGatherBytes[%,d]",
                 query.getId(),
-                url
+                url,
+                currentTotalBytesGathered,
+                maxScatterGatherBytes
             );
             setupResponseReadFailure(msg, null);
             throw new ResourceLimitExceededException(msg);
diff --git 
a/server/src/test/java/org/apache/druid/query/QueryRunnerBasedOnClusteredClientTestBase.java
 
b/server/src/test/java/org/apache/druid/query/QueryRunnerBasedOnClusteredClientTestBase.java
index fdd7ca66a45..9385495cde7 100644
--- 
a/server/src/test/java/org/apache/druid/query/QueryRunnerBasedOnClusteredClientTestBase.java
+++ 
b/server/src/test/java/org/apache/druid/query/QueryRunnerBasedOnClusteredClientTestBase.java
@@ -42,7 +42,6 @@ import 
org.apache.druid.java.util.common.granularity.Granularities;
 import org.apache.druid.java.util.common.io.Closer;
 import org.apache.druid.java.util.metrics.StubServiceEmitter;
 import org.apache.druid.query.aggregation.CountAggregatorFactory;
-import org.apache.druid.query.context.ConcurrentResponseContext;
 import org.apache.druid.query.context.ResponseContext;
 import org.apache.druid.query.timeseries.TimeseriesResultValue;
 import org.apache.druid.query.topn.TopNQueryConfig;
@@ -228,9 +227,7 @@ public abstract class 
QueryRunnerBasedOnClusteredClientTestBase
 
   protected static ResponseContext responseContext()
   {
-    final ResponseContext responseContext = 
ConcurrentResponseContext.createEmpty();
-    responseContext.initializeRemainingResponses();
-    return responseContext;
+    return DirectDruidClient.makeResponseContextForQuery();
   }
 
   protected static DataSegment newSegment(


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

Reply via email to