You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since netty bootstrap.connect uses only first address of unresolved InetSocketAddress 4.x does not even try to connect to other when it fails.
Consider following test:
@Test
public void cannot_connect_if_first_node_is_unavailable() {
// Reproduce case when first two dns record contains nodes that are unresponsive
// With RESOLVE_CONTACT_POINTS set to false
DriverConfigLoader loader =
new DefaultProgrammaticDriverConfigLoaderBuilder()
.withBoolean(TypedDriverOption.RESOLVE_CONTACT_POINTS.getRawOption(), false)
.withBoolean(TypedDriverOption.RECONNECT_ON_INIT.getRawOption(), true)
.withStringList(
TypedDriverOption.CONTACT_POINTS.getRawOption(),
Collections.singletonList("test.cluster.fake:9042"))
.build();
CqlSessionBuilder builder = new CqlSessionBuilder().withConfigLoader(loader);
CqlSession session;
try (CcmBridge ccmBridge = CcmBridge.builder().withNodes(3).withIpPrefix("127.0.1.").build()) {
MultimapHostResolverProvider.removeResolverEntries("test.cluster.fake");
MultimapHostResolverProvider.addResolverEntry(
"test.cluster.fake", ccmBridge.getNodeIpAddress(11));
MultimapHostResolverProvider.addResolverEntry(
"test.cluster.fake", ccmBridge.getNodeIpAddress(2));
MultimapHostResolverProvider.addResolverEntry(
"test.cluster.fake", ccmBridge.getNodeIpAddress(3));
ccmBridge.create();
ccmBridge.start();
session = builder.build();
SimpleStatement statement =
new SimpleStatementBuilder("SELECT * FROM system.local")
.setTimeout(Duration.ofSeconds(3))
.build();
session.execute(statement);
ccmBridge.stop(2);
session.execute(statement);
}
}
The text was updated successfully, but these errors were encountered:
Since netty
bootstrap.connect
uses only first address of unresolvedInetSocketAddress
4.x does not even try to connect to other when it fails.Consider following test:
The text was updated successfully, but these errors were encountered: