korlov42 commented on code in PR #6566:
URL: https://github.com/apache/ignite-3/pull/6566#discussion_r2465719697
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -133,24 +134,35 @@ public final class ReliableChannel implements
AutoCloseable {
/** Inflights. */
private final ClientTransactionInflights inflights;
+ /**
+ * A validator that is called when a connection to a node is established,
+ * if it throws an exception, the network channel to that node will be
closed.
+ */
+ private final @Nullable Consumer<ProtocolContext> channelValidator;
Review Comment:
nitpicking: rather than using generic `Consumer`, I would introduce
interface `ChannelValidator`, and encapsulate external check of mandatory
features and internal cluster Id validation
##########
modules/client/src/main/java/org/apache/ignite/internal/client/ReliableChannel.java:
##########
@@ -918,6 +930,10 @@ private CompletableFuture<ClientChannel>
getOrCreateChannelAsync() {
nodeChannelsByName.remove(oldServerNode.name(), this);
}
+ if (channelValidator != null) {
Review Comment:
I think, any validation must come before any change of internal state (see
updates of `nodeChannelsByName `)
--
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]