You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2023/03/10 20:00:07 UTC
[GitHub] [pinot] xiangfu0 commented on a diff in pull request #10401: [multistage] early terminate from query dispatcher
xiangfu0 commented on code in PR #10401:
URL: https://github.com/apache/pinot/pull/10401#discussion_r1132821590
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/executor/OpChainSchedulerService.java:
##########
@@ -38,15 +40,28 @@
@SuppressWarnings("UnstableApiUsage")
public class OpChainSchedulerService extends AbstractExecutionThreadService {
private static final Logger LOGGER = LoggerFactory.getLogger(OpChainSchedulerService.class);
- // Default time scheduler is allowed to wait for a runnable OpChain to be available
+ /**
+ * Default time scheduler is allowed to wait for a runnable OpChain to be available.
+ */
private static final long DEFAULT_SCHEDULER_NEXT_WAIT_MS = 100;
+ /**
+ * Default cancel signal retention, this should be set to several times larger than
+ * {@link org.apache.pinot.query.service.QueryConfig#DEFAULT_SCHEDULER_RELEASE_TIMEOUT_MS}.
+ */
+ private static final long DEFAULT_SCHEDULER_CANCELLATION_SIGNAL_RETENTION_MS = 60_000L;
private final OpChainScheduler _scheduler;
private final ExecutorService _workerPool;
+ private final Cache<Long, Long> _cancelledRequests;
public OpChainSchedulerService(OpChainScheduler scheduler, ExecutorService workerPool) {
+ this(scheduler, workerPool, DEFAULT_SCHEDULER_CANCELLATION_SIGNAL_RETENTION_MS);
+ }
+
+ public OpChainSchedulerService(OpChainScheduler scheduler, ExecutorService workerPool, long cancelRetentionMs) {
_scheduler = scheduler;
_workerPool = workerPool;
+ _cancelledRequests = CacheBuilder.newBuilder().expireAfterWrite(cancelRetentionMs, TimeUnit.MILLISECONDS).build();
Review Comment:
what if user set longer timeout during query runtime ?
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org