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

James Taylor commented on PHOENIX-1172:
---------------------------------------

Two comments, one small, one bigger:
- Wouldn't this be simpler if you set initializationException in the catch of 
the SQLException and again in a new catch Throwable?
- Why do we need the locking you added? Seems like the only race condition is 
between connect and close. Why not just have close synchronize on 
latestMetaDataLock and remove the checkClosed() call? The addTable and 
removeTable calls can just do a null check - there's no harm if these are 
called right before/after  a close.
{code}
    @Override
    public PhoenixConnection connect(String url, Properties info) throws 
SQLException {
        checkClosed();
        synchronized (latestMetaDataLock) {
            throwConnectionClosedIfNullMetaData();
            latestMetaDataLock.notifyAll();
            return new PhoenixConnection(this, url, info, latestMetaData);
        }
    }
{code}

> Prevent lock contention in ConnectionQueryServicesImpl. Fix exception 
> handling. 
> --------------------------------------------------------------------------------
>
>                 Key: PHOENIX-1172
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1172
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0, 3.1, 4.1
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>             Fix For: 5.0.0, 3.1, 4.1
>
>         Attachments: PHOENIX-1172.patch
>
>




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

Reply via email to