Copilot commented on code in PR #5666:
URL: https://github.com/apache/ignite-3/pull/5666#discussion_r2049134546


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -393,18 +420,36 @@ private void handshake(ChannelHandlerContext ctx, 
ClientMessageUnpacker unpacker
             int clientCode = unpacker.unpackInt();
 
             BitSet clientFeatures = HandshakeUtils.unpackFeatures(unpacker);
-            Map<HandshakeExtension, Object> extensions = 
HandshakeUtils.unpackExtensions(unpacker);
+            Map<HandshakeExtension, Object> clientHandshakeExtensions = 
HandshakeUtils.unpackExtensions(unpacker);
+            String computeExecutorId = (String) 
clientHandshakeExtensions.get(HandshakeExtension.COMPUTE_EXECUTOR_ID);
+
+            if (computeExecutorId != null) {
+                CompletableFuture<PlatformComputeConnection> computeConnFut = 
computeConnectionFunc.apply(computeExecutorId);
+
+                if (computeConnFut == null) {
+                    LOG.warn("Invalid compute executor ID, client connection 
rejected [connectionId=" + connectionId
+                            + ", remoteAddress=" + 
ctx.channel().remoteAddress() + "]: " + computeExecutorId);
+
+                    ctx.close();
+                    return;
+                }
+
+                // Bypass authentication for compute executor connections.
+                handshakeSuccess(ctx, packer, UserDetails.UNKNOWN, 
clientFeatures, clientVer, clientCode);
+
+                // Ready to handle compute requests now.
+                computeConnFut.complete(this::executeJobAsync);

Review Comment:
   The method reference 'this::executeJobAsync' has a signature that does not 
match the expected type (PlatformComputeConnection). Consider revising the type 
conversion or wrapping the call to produce an appropriate 
PlatformComputeConnection instance.
   ```suggestion
                   computeConnFut.complete(() -> new 
PlatformComputeConnection(this::executeJobAsync));
   ```



-- 
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]

Reply via email to