Copilot commented on code in PR #16142:
URL: https://github.com/apache/pinot/pull/16142#discussion_r2197179730
##########
pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java:
##########
@@ -814,14 +837,21 @@ void killAllQueries() {
if (config.isOomKillQueryEnabled()) {
int killedCount = 0;
+ Set<String> terminatedQueryIds = new HashSet<>();
for (Map.Entry<Thread,
CPUMemThreadLevelAccountingObjects.ThreadEntry> entry :
_threadEntriesMap.entrySet()) {
CPUMemThreadLevelAccountingObjects.ThreadEntry threadEntry =
entry.getValue();
CPUMemThreadLevelAccountingObjects.TaskEntry taskEntry =
threadEntry.getCurrentThreadTaskStatus();
- if (taskEntry != null && taskEntry.isAnchorThread()) {
- threadEntry._errorStatus
- .set(new RuntimeException(String.format("Query killed due to
%s out of memory!", _instanceType)));
- taskEntry.getAnchorThread().interrupt();
- killedCount += 1;
+ if (taskEntry != null &&
!terminatedQueryIds.contains(taskEntry.getQueryId())) {
+ if (_queryCancelCallbacks.containsKey(taskEntry.getQueryId())) {
Review Comment:
When cancelling via callback, `killedCount` is not incremented, so the
query-killed metric may undercount. Consider incrementing `killedCount` in the
callback branch as well.
--
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]