Copilot commented on code in PR #16172:
URL: https://github.com/apache/pinot/pull/16172#discussion_r2161223045
##########
pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java:
##########
@@ -482,6 +482,17 @@ public Map<String, AggregatedStats> aggregate(boolean
isTriggered) {
public void postAggregation(Map<String, AggregatedStats>
aggregatedUsagePerActiveQuery) {
}
+ protected void logQueryResourceUsage(Map<String, ? extends
QueryResourceTracker> aggregatedUsagePerActiveQuery) {
+ LOGGER.warn("Current task status recorded is {}", _threadEntriesMap);
+ LOGGER.warn("Query aggregation results {} for the previous kill.",
aggregatedUsagePerActiveQuery.toString());
+ }
+
+ protected void logTerminatedQuery(QueryResourceTracker
queryResourceTracker, long totalHeapMemoryUsage) {
+ LOGGER.error("Query {} terminated. Memory Usage: {}. Cpu Usage: {}.
Total Heap Usage: {}",
Review Comment:
[nitpick] Consider whether an ERROR log level is appropriate for logging
query terminations. If termination is an expected outcome due to OOM
conditions, switching to a WARN level might better reflect the operational
scenario.
```suggestion
LOGGER.warn("Query {} terminated. Memory Usage: {}. Cpu Usage: {}.
Total Heap Usage: {}",
```
##########
pinot-core/src/main/java/org/apache/pinot/core/accounting/PerQueryCPUMemAccountantFactory.java:
##########
@@ -850,6 +861,11 @@ void killAllQueries() {
System.gc();
_numQueriesKilledConsecutively = 0;
}
+ Map<String, ? extends QueryResourceTracker> queryResources =
getQueryResources();
Review Comment:
Consider reusing the 'queryResources' variable for the subsequent
logQueryResourceUsage call to avoid multiple evaluations of getQueryResources()
and ensure consistent logging.
--
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]