ptupitsyn commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2448465807


##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -918,6 +930,14 @@ private CompletableFuture<ClientChannel> 
getOrCreateChannelAsync() {
                         nodeChannelsByName.remove(oldServerNode.name(), this);
                     }
 
+                    if (requiredFeature != null && 
!ch.protocolContext().isFeatureSupported(requiredFeature)) {
+                        throw new IgniteClientConnectionException(

Review Comment:
   Let's make sure to close the channel here.



##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -568,7 +576,7 @@ private synchronized boolean initChannelHolders() {
 
             // Create new holders for new addrs.
             if (!curAddrs.containsKey(addr)) {
-                ClientChannelHolder hld = new ClientChannelHolder(new 
ClientChannelConfiguration(clientCfg, addr));
+                ClientChannelHolder hld = new ClientChannelHolder(new 
ClientChannelConfiguration(clientCfg, addr), requiredFeature);

Review Comment:
   `ClientChannelHolder` is not static and should be able to access 
`requiredFeature`?



##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -133,24 +134,31 @@ public final class ReliableChannel implements 
AutoCloseable {
     /** Inflights. */
     private final ClientTransactionInflights inflights;
 
+    /** The feature that the node must support in order to connect to it. */
+    private final @Nullable ProtocolBitmaskFeature requiredFeature;
+
     /**
      * Constructor.
      *
      * @param chFactory Channel factory.
      * @param clientCfg Client config.
      * @param metrics Client metrics.
      * @param observableTimeTracker Tracker of the latest time observed by 
client.
+     * @param requiredFeature The feature that the node must support in order 
to connect to it.
      */
     ReliableChannel(
             ClientChannelFactory chFactory,
             IgniteClientConfiguration clientCfg,
             ClientMetricSource metrics,
-            HybridTimestampTracker observableTimeTracker) {
+            HybridTimestampTracker observableTimeTracker,
+            @Nullable ProtocolBitmaskFeature requiredFeature

Review Comment:
   Might be something more generic like `Consumer<ProtocolContext> 
channelValidatior`



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