Copilot commented on code in PR #6512:
URL: https://github.com/apache/ignite-3/pull/6512#discussion_r2313613722
##########
modules/client/src/main/java/org/apache/ignite/internal/client/TcpClientChannel.java:
##########
@@ -434,6 +434,29 @@ private <T> CompletableFuture<T> send(
}
}
+ private <T> CompletableFuture<T> completeAsync(
+ @Nullable PayloadReader<T> payloadReader,
+ @Nullable CompletableFuture<PayloadInputChannel> notificationFut,
+ ClientMessageUnpacker unpacker
+ ) {
+ try {
+ CompletableFuture<T> resFut = new CompletableFuture<>();
+
+ // Use asyncContinuationExecutor explicitly to close unpacker if
the executor throws.
+ asyncContinuationExecutor.execute(() -> {
+ try {
+ resFut.complete(complete(payloadReader, notificationFut,
unpacker));
+ } catch (Throwable t) {
+
resFut.completeExceptionally(ViewUtils.ensurePublicException(t));
Review Comment:
The unpacker is not closed when an exception occurs during task execution
within the lambda. This could lead to resource leaks if the `complete` method
throws an exception.
```suggestion
resFut.completeExceptionally(ViewUtils.ensurePublicException(t));
} finally {
unpacker.close();
```
--
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]