Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Socket Error when repeatedly connecting to cluster #105

Closed
mbroecheler opened this Issue · 1 comment

2 participants

@mbroecheler

We are doing something like this:

for ( a-bunch-of-time) {
Build astyanax cluster and keyspace context
Do a bunch of operations against CFs in a remote cassandra cluster
shutdown the astyanax keyspace and cluster context
}

After about 40-60 iterations of that for loop, we get a "too many open files" error (copy&pasted below) when trying to establish a new connection to the cassandra cluster. When we restart the program, it works fine again so there is some sort of socket leak going on and we cannot find it. As illustrated in the pseudo-code above we are properly shutting down the cluster and keyspace context at the end of each iteration.

Is there something else we need to clean up or is this an Astyanax internal leak?

Thanks, Matthias

6325301 [RetryService : 10.101.41.184(10.101.41.184):9160] DEBUG com.netflix.astyanax.thrift.ThriftConverter - Too many open files
6325301 [RetryService : 10.101.41.184(10.101.41.184):9160] ERROR org.apache.thrift.transport.TSocket - Could not configure socket.
java.net.SocketException: Too many open files
at java.net.Socket.createImpl(Socket.java:414)
at java.net.Socket.getImpl(Socket.java:477)
at java.net.Socket.setSoLinger(Socket.java:918)
at org.apache.thrift.transport.TSocket.initSocket(TSocket.java:116)
at org.apache.thrift.transport.TSocket.(TSocket.java:107)
at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$1.open(ThriftSyncConnectionFactoryImpl.java:156)
at com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.reconnect(SimpleHostConnectionPool.java:314)
at com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool.access$100(SimpleHostConnectionPool.java:59)
at com.netflix.astyanax.connectionpool.impl.SimpleHostConnectionPool$1.run(SimpleHostConnectionPool.java:285)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

@elandau
Owner

The context is meant to be opened once at application startup. Can you please try this with the latest version of astyanax as there have since been fixes to resource leaks.

@elandau elandau closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.