vrajat commented on code in PR #16445:
URL: https://github.com/apache/pinot/pull/16445#discussion_r2280260044


##########
pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java:
##########
@@ -860,19 +890,37 @@ void reschedule() {
       void killAllQueries() {
         QueryMonitorConfig config = _queryMonitorConfig.get();
 
-        if (config.isOomKillQueryEnabled()) {
+        if (config.isOomKillQueryEnabled() && !config.isThreadSelfTerminate()) 
{

Review Comment:
   Interrupt is only sent to the anchor thread. Refer: 
https://github.com/apache/pinot/blob/master/pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java#L529
   
   Anchor Thread does not interrupt other threads in SSE. So there is no code 
yet for _interrupting_ query execution thread from PerQuery.... 
   
   Refer: 
https://github.com/apache/pinot/blob/e78c83690447e7e79d7f5daf27d24bf6caca11a0/pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java#L147
   
   For MSE, Cancel Callback was added recently. The callback does call 
interrupt on all threads. However there isn't high confidence if 
`OpChainSchedulerService.cancel` works. 
   
   Refer: 
https://github.com/apache/pinot/blob/master/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/executor/OpChainSchedulerService.java#L120
   
   If you plan to add code to also cancel query execution threads - then yes - 
both self-terminate and interrupt of query execution threads are required. One 
option is to use cancel callbacks. The better approach is for `QueryScheduler` 
or `QueryRunner` to proactively cancel all threads of a query when one of them 
returns an error. Its control flow smell for one query execution thread to take 
on the responsibility of interrupting other query execution threads.  



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