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

Error while Shutting down tomcat while using astyanax library #616

Open
harrydevnull opened this issue Mar 21, 2016 · 0 comments
Open

Error while Shutting down tomcat while using astyanax library #616

harrydevnull opened this issue Mar 21, 2016 · 0 comments

Comments

@harrydevnull
Copy link

I use astyanax cassandra driver on tomcat to access data from cassandra. while stopping tomcat server; it is hung on threads started from astyanax library. Has any one come across this issue?
this seems to create memory leaks for my application
is there any resolution for this?

appears to have started a thread named [SMA_ScoreReset] but has failed to stop it. This is very likely to create a memory leak
appears to have started a thread named [pool-9-thread-1] but has failed to stop it. This is very likely to create a memory leak
appears to have started a thread named [pool-7-thread-35] but has failed to stop it. This is very likely to create a memory leak

I do have code which is to supposed to bring down the connection on shutdown

    @PreDestroy
    public void cleanup() {
        if(!this.shutdownPerformed.booleanValue() && this.contextMap != null && !this.contextMap.isEmpty()) {
            this.shutdownPerformed = Boolean.valueOf(true);
            logger.info("Shutdown context for " + this.contextMap.keySet());
            Iterator i$ = this.contextMap.keySet().iterator();

            while(i$.hasNext()) {
                String ksName = (String)i$.next();
                AstyanaxContext context = (AstyanaxContext)this.contextMap.get(ksName);
                if(context != null) {
                    logger.info("shutdown context for keyspace " + ksName);
                    ExecutorService asyncExecutor = context.getAstyanaxConfiguration().getAsyncExecutor();
                    asyncExecutor.shutdown();

                    try {
                        asyncExecutor.awaitTermination(10000L, TIMEUNIT.MILLISECONDS);
                    } catch (InterruptedException var6) {
                        ;
                    }

                    context.shutdown();
                }
            }
        }

    }
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