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

Samarth Jain commented on PHOENIX-1562:
---------------------------------------

I am no longer able to reproduce the original NPE since my dev environment has 
changed. Unfortunately the exception doesn't tell which part returned null. My 
guess is it was probably cacheUsingTableRef.getTable(). [~maryannxue] - do you 
expect making the cacheUsingTableRef a concurrent map will fix the NPE?

Also, it looks like closing connection in cases when we are doing joins (and 
possibly other operations) is pretty expensive - O(num regions).
 
{code}
at 
org.apache.phoenix.cache.ServerCacheClient.removeServerCache(ServerCacheClient.java:285)
        at 
org.apache.phoenix.cache.ServerCacheClient.access$000(ServerCacheClient.java:80)
        at 
org.apache.phoenix.cache.ServerCacheClient$ServerCache.close(ServerCacheClient.java:140)
        at 
org.apache.phoenix.util.SQLCloseables.closeAllQuietly(SQLCloseables.java:53)
        at org.apache.phoenix.util.SQLCloseables.closeAll(SQLCloseables.java:43)
        at 
org.apache.phoenix.execute.BaseQueryPlan$1.close(BaseQueryPlan.java:235)
        at 
org.apache.phoenix.iterate.DelegateResultIterator.close(DelegateResultIterator.java:39)
        at 
org.apache.phoenix.execute.SortMergeJoinPlan$SemiAntiJoinIterator.close(SortMergeJoinPlan.java:419)
        at 
org.apache.phoenix.jdbc.PhoenixResultSet.close(PhoenixResultSet.java:153)
        at 
org.apache.phoenix.util.SQLCloseables.closeAllQuietly(SQLCloseables.java:53)
        at org.apache.phoenix.util.SQLCloseables.closeAll(SQLCloseables.java:43)
        at 
org.apache.phoenix.jdbc.PhoenixStatement.close(PhoenixStatement.java:964)
        at 
org.apache.phoenix.util.SQLCloseables.closeAllQuietly(SQLCloseables.java:53)
        at org.apache.phoenix.util.SQLCloseables.closeAll(SQLCloseables.java:43)
        at 
org.apache.phoenix.jdbc.PhoenixConnection.closeStatements(PhoenixConnection.java:386)
        at 
org.apache.phoenix.jdbc.PhoenixConnection.close(PhoenixConnection.java:400)
{code}

[~jamestaylor] - it looks like we should be doing operations like these 
asynchronously so that the original request doesn't bear the cost of these 
somewhat unrelated operations.  

> NPE in ServerCacheClient
> ------------------------
>
>                 Key: PHOENIX-1562
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1562
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>         Attachments: 1562.patch
>
>
> I keep getting intermittent NPEs when running SubqueryUsingSortMergeJoinIT.
> {code}
> java.lang.NullPointerException: null
>       at 
> org.apache.phoenix.cache.ServerCacheClient.removeServerCache(ServerCacheClient.java:285)
>       at 
> org.apache.phoenix.cache.ServerCacheClient.access$000(ServerCacheClient.java:80)
>       at 
> org.apache.phoenix.cache.ServerCacheClient$ServerCache.close(ServerCacheClient.java:140)
>       at 
> org.apache.phoenix.util.SQLCloseables.closeAllQuietly(SQLCloseables.java:53)
>       at org.apache.phoenix.util.SQLCloseables.closeAll(SQLCloseables.java:43)
>       at 
> org.apache.phoenix.execute.BaseQueryPlan$1.close(BaseQueryPlan.java:235)
>       at 
> org.apache.phoenix.iterate.DelegateResultIterator.close(DelegateResultIterator.java:39)
>       at 
> org.apache.phoenix.execute.SortMergeJoinPlan$SemiAntiJoinIterator.close(SortMergeJoinPlan.java:419)
>       at 
> org.apache.phoenix.jdbc.PhoenixResultSet.close(PhoenixResultSet.java:153)
>       at 
> org.apache.phoenix.util.SQLCloseables.closeAllQuietly(SQLCloseables.java:53)
>       at org.apache.phoenix.util.SQLCloseables.closeAll(SQLCloseables.java:43)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.close(PhoenixStatement.java:964)
>       at 
> org.apache.phoenix.util.SQLCloseables.closeAllQuietly(SQLCloseables.java:53)
>       at org.apache.phoenix.util.SQLCloseables.closeAll(SQLCloseables.java:43)
>       at 
> org.apache.phoenix.jdbc.PhoenixConnection.closeStatements(PhoenixConnection.java:386)
>       at 
> org.apache.phoenix.jdbc.PhoenixConnection.close(PhoenixConnection.java:400)
>       at 
> org.apache.phoenix.end2end.SubqueryUsingSortMergeJoinIT.testComparisonSubquery(SubqueryUsingSortMergeJoinIT.java:822)
> {code}
> [~maryannxue] - Do you mind taking a look? Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to