[
https://issues.apache.org/jira/browse/PHOENIX-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14274275#comment-14274275
]
Maryann Xue commented on PHOENIX-1562:
--------------------------------------
[~samarthjain] The map should indeed be concurrent. It's a bug right now. So
regardless of whether this patch would fix your problem or not, it at least
helped me discover this bug. Thanks!
Besides, this is very likely the cause. Coz we expect the map always contains
the corresponding cacheID once addServerCache succeeds and returns, otherwise
there would not be a ServerCache object (which later calls removeServerCache in
its own close method) with that cacheID at all. And the TableRef object can
never be null either, otherwise addServerCache() would have failed from NPE
earlier. So the only possibility I can think of now is the use of hashmap in a
multithreading way. Actually there is exactly one query in that failed case
that hash-joins two tables in parallel.
> 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)