xtern commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2454664853
##########
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:
Thanks. Replaced with `Consumer<ProtocolContext> channelValidatior`.
##########
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:
Fixed, thanks
##########
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:
The channel will be closed in the exception handling block.
--
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]