Skip to content


Socket Error when repeatedly connecting to cluster #105

mbroecheler opened this Issue · 1 comment

2 participants


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 :] DEBUG - Too many open files
6325301 [RetryService :] ERROR org.apache.thrift.transport.TSocket - Could not configure socket. Too many open files
at org.apache.thrift.transport.TSocket.initSocket(
at org.apache.thrift.transport.TSocket.(
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask$Sync.innerRun(
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(
at java.util.concurrent.ScheduledThreadPoolExecutor$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Netflix, Inc. member

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.