FrankChen021 commented on code in PR #19235:
URL: https://github.com/apache/druid/pull/19235#discussion_r3141492639
##########
processing/src/main/java/org/apache/druid/query/ChainedExecutionQueryRunner.java:
##########
@@ -85,6 +88,13 @@ public Sequence<T> run(final QueryPlus<T> queryPlus, final
ResponseContext respo
final QueryContext context = query.context();
final boolean usePerSegmentTimeout = context.usePerSegmentTimeout();
final long perSegmentTimeout = context.getPerSegmentTimeout();
+ final int samplingWindow = context.getPerSegmentSamplingWindow();
+ final long queryStartNanos = System.nanoTime();
Review Comment:
[P2] Start extrapolation clock when the lazy sequence is consumed
ChainedExecutionQueryRunner.run returns a lazy BaseSequence, and the segment
futures are not submitted until IteratorMaker.make() runs during sequence
consumption. Starting queryStartNanos here means any delay between creating the
sequence and consuming it is counted as segment execution time, unlike the
existing future.get(context.getTimeout(), ...) timeout which starts inside
make(). With perSegmentSamplingWindow enabled, a wrapper or delayed consumer
can cause the first completed segments to extrapolate from idle time and cancel
a query that has not actually exceeded its processing timeout; move the start
timestamp into make() near the future submission/listener setup.
--
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]