[ 
https://issues.apache.org/jira/browse/PHOENIX-3728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16553103#comment-16553103
 ] 

Josh Elser commented on PHOENIX-3728:
-------------------------------------

{code:java}
for (LinkedBlockingQueue<WeakReference<PhoenixConnection>> queue : 
connectionQueues) {
  queue.clear();
}{code}
You would need to do something like the above instead of 
{{connectionQueues.clear()}}, *after* calling close() on 
ConnectionQueryServicesImpl (to make sure the executor service stops trying to 
run new RenewalThreads).

I am a little concerned about how the redeploy logic in Tomcat works though. 
java.sql.DriverManager is going to be caching instances of our PhoenixDriver – 
the one we just closed. Are we sure that Tomcat is going to clean up enough 
internals to make sure that we get a fresh instance that can actually work?

I would like to see a test along with this change that:
 * Connects to phoenix and does some trivial query
 * Closes the Phoenix "internals" in the same manner that Tomcat would
 * Reconnects to Phoenix in the same manner that Tomcat would
 * Verify that some trivial query still works

> renewLeaseExecutor.shutdown() not getting called on PhoenixDriver close() 
> method invocation.
> --------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-3728
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3728
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Komal Bansal
>            Priority: Blocker
>         Attachments: PHOENIX-3728.patch, patch
>
>
> We are using PhoenixDriver for a java service deployed in tomcat. This driver 
> creates pool of pre-specified number of  threads for lease renewal on first 
> connection creation. When the service is redeployed, this thread pool is not 
> getting cleared, hence causing memory leaks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to