gortiz commented on code in PR #15609: URL: https://github.com/apache/pinot/pull/15609#discussion_r2055477662
########## pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java: ########## @@ -443,11 +443,27 @@ private BrokerResponse query(QueryEnvironment.CompiledQuery query, long requestI Tracing.ThreadAccountantOps.clear(); onQueryFinish(requestId); } - long executionEndTimeNs = System.nanoTime(); - updatePhaseTimingForTables(tableNames, BrokerQueryPhase.QUERY_EXECUTION, - executionEndTimeNs - executionStartTimeNs); BrokerResponseNativeV2 brokerResponse = new BrokerResponseNativeV2(); + + QueryProcessingException processingException = queryResults.getProcessingException(); + if (processingException != null) { + brokerResponse.addException(processingException); + QueryErrorCode errorCode = QueryErrorCode.fromErrorCode(processingException.getErrorCode()); + if (errorCode == QueryErrorCode.EXECUTION_TIMEOUT) { + for (String table : tableNames) { + _brokerMetrics.addMeteredTableValue(table, BrokerMeter.BROKER_RESPONSES_WITH_TIMEOUTS, 1); + } + LOGGER.warn("Timed out executing request {}: {}", requestId, query); Review Comment: This replicates the logic already present in lines 428 and 433. Other error cases are either: 1. Exceptions thrown in the same way as before, so they won't reach line 449. 2. Errors caught internally and returned as an erroneous BrokerResponseNative, in which case we don't need to do anything else TL;DR: I've added these lines here to keep the same behavior when timeout is caught inside _queryDispatcher.submitAndReduce -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org