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

James Taylor commented on PHOENIX-1104:
---------------------------------------

+1 with this minor tweak to shutdown the executor in it's own nested try/catch 
at the end:
{code}
    @Override
    public synchronized void close() throws SQLException {
        if (closed) {
            return;
        }
        closed = true;
        try {
            Collection<ConnectionQueryServices> connectionQueryServices = 
connectionQueryServicesMap.values();
             try {
                SQLCloseables.closeAll(connectionQueryServices);
            } finally {
                connectionQueryServices.clear();
            }
        } finally {
            if (services != null) {
                try {
                    services.close();
                } finally {
                    ExecutorService executor = services.getExecutor();
                    // Even if something wrong happened while closing services 
above, we still
                    // want to set it to null. Otherwise, we will end up having 
a possibly non-working
                    // services instance. 
                    services = null;
                    executor.shutdown();
                }
            }
        }
    }
{code}


> Do not shutdown threadpool when initialization fails
> ----------------------------------------------------
>
>                 Key: PHOENIX-1104
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1104
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 3.1, 4.1
>            Reporter: Mujtaba Chohan
>            Priority: Minor
>         Attachments: P-1104.patch
>
>
> If Phoenix first connects when HBase master is initializing then Phoenix 
> throws Incompatible jar exception on subsequent connections from same JVM.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to