gortiz commented on code in PR #16899:
URL: https://github.com/apache/pinot/pull/16899#discussion_r2402144603
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/QueryRunner.java:
##########
@@ -341,15 +341,14 @@ private void notifyErrorAfterSubmission(int stageId,
ErrorMseBlock errorBlock, W
}
long deadlineMs = QueryThreadContext.getPassiveDeadlineMs();
for (RoutingInfo routingInfo : routingInfos) {
- try {
- StatMap<MailboxSendOperator.StatKey> statMap = new
StatMap<>(MailboxSendOperator.StatKey.class);
- SendingMailbox sendingMailbox =
- _mailboxService.getSendingMailbox(routingInfo.getHostname(),
routingInfo.getPort(),
- routingInfo.getMailboxId(), deadlineMs, statMap);
+ StatMap<MailboxSendOperator.StatKey> statMap = new
StatMap<>(MailboxSendOperator.StatKey.class);
+ try (SendingMailbox sendingMailbox =
_mailboxService.getSendingMailbox(routingInfo.getHostname(),
+ routingInfo.getPort(), routingInfo.getMailboxId(), deadlineMs,
statMap)) {
// TODO: Here we are breaking the stats invariants, sending errors
without including the stats of the
// current stage. We will need to fix this in future, but for now, we
are sending the error block without
// the stats.
sendingMailbox.send(errorBlock, Collections.emptyList());
+ sendingMailbox.complete();
Review Comment:
This was the error I've found, yes.
But this proposal, making sending mailboxes closable, is in my opinion the
correct way to write this code. This is the standard approach in Java, and it
protects us from future issues.
--
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]