Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetryService threads seem to be leaked #591

Open
ClaireAB opened this issue Aug 26, 2015 · 0 comments
Open

RetryService threads seem to be leaked #591

ClaireAB opened this issue Aug 26, 2015 · 0 comments

Comments

@ClaireAB
Copy link

We're using Astyanax 2.0.1 to connect to a Cassandra database with multiple keyspaces. We use a separate AstyanaxContext to connect to each keyspace.

I have recently run some testing where I block the traffic to the server running Cassandra periodically and then recover it while making requests to the database continuously. (This testing was prompted by a problem where a server hung when it could not talk to the Cassandra server).

After running this for 4 days I did a Java thread dump and there were 185 RetryService threads. I reconnected the Cassanadra server and stopped my stress test running. A few hours later these threads were still there. So nothing has cleaned them up and they seem to be leaking.

Is this an Astyanax bug or is there something we should be doing to clean them up?

We also have code that shuts the context down when we notice that the seeds for the connection have changed. We then recreate the context from scratch. Is this the correct way to do this or can we change the seeds without shutting down the context? Is it possible that the RetryService threads are related to the contexts that have been shutdown and if so how do I clean them up?

Here is the code we use to build the context:

ConnectionPoolConfigurationImpl poolConfiguration =
new ConnectionPoolConfigurationImpl(MVS_OBS_POOL)
.setPort(DB_PORT)
.setMaxConnsPerHost(1)
.setSeeds(sSeeds);

Builder builder = new AstyanaxContext.Builder()
  .forKeyspace(keyspace)
  .withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
    .setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
    .setDefaultWriteConsistencyLevel(ConsistencyLevel.CL_LOCAL_ONE)
    .setDefaultReadConsistencyLevel(ConsistencyLevel.CL_LOCAL_ONE)
    .setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE))
  .withConnectionPoolConfiguration(poolConfiguration)
  .withConnectionPoolMonitor(new CountingConnectionPoolMonitor());

AstyanaxContext<Keyspace> context = builder.buildKeyspace(ThriftFamilyFactory.getInstance());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant