0

So we're running the our application with 3 node DSE cluster and singleton DSESession object. Session or connection is not closed anywhere in the codebase.

But randomly I'm getting the following error message. Almost for every 400 requests, there is a failure.

com.datastax.driver.core.exceptions.TransportException: [/ipaddress:9042] Connection has been closed at com.datastax.driver.core.Connection$ConnectionCloseFuture.force(Connection.java:1210) at com.datastax.driver.core.Connection$ConnectionCloseFuture.force(Connection.java:1195) at com.datastax.driver.core.Connection.defunct(Connection.java:445) at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:1128) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:280) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:259) at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:251) at io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught(ChannelInboundHandlerAdapter.java:131) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:280) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:259) at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:251) at io.netty.channel.ChannelHandlerAdapter.exceptionCaught(ChannelHandlerAdapter.java:88) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:280) at io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:259) at io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:251)

Code used for the connection is provided below.

DseCluster.Builder dseBuilder = DseCluster.builder();
dseBuilder.addContactPoints(contactPoints);
dseBuilder.withLoadBalancingPolicy(DCAwareRoundRobinPolicy.builder()
    .withLocalDc("us-west-2")
    .withUsedHostsPerRemoteDc(3)
    .allowRemoteDCsForLocalConsistencyLevel()
    .build());
QueryOptions queryOptions = new QueryOptions();
queryOptions.setConsistencyLevel(ConsistencyLevel.LOCAL_ONE);
dseBuilder.withQueryOptions(queryOptions);
dseBuilder.withGraphOptions(new GraphOptions().setGraphName(graphName));
DseSession dseSession = dseBuilder.build().connect();
return DseGraph.traversal(dseSession);

And not able to find anything else from cassandra logs also. It'll be helpful if someone faced this issue or tell me how to debug this one.

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
ashoksl
  • 383
  • 6
  • 17

0 Answers0