[
https://issues.apache.org/jira/browse/HBASE-25307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Work on HBASE-25307 started by Balazs Meszaros.
-----------------------------------------------
> ThreadLocal pooling leads to NullPointerException
> -------------------------------------------------
>
> Key: HBASE-25307
> URL: https://issues.apache.org/jira/browse/HBASE-25307
> Project: HBase
> Issue Type: Bug
> Components: Client
> Affects Versions: 3.0.0-alpha-1
> Reporter: Balazs Meszaros
> Assignee: Balazs Meszaros
> Priority: Major
>
> We got NPE after setting {{hbase.client.ipc.pool.type}} to {{thread-local}}:
> {noformat}
> 20/11/18 01:53:04 ERROR yarn.ApplicationMaster: User class threw exception:
> java.lang.NullPointerException
> java.lang.NullPointerException
> at
> org.apache.hadoop.hbase.ipc.AbstractRpcClient.close(AbstractRpcClient.java:496)
> at
> org.apache.hadoop.hbase.client.ConnectionImplementation.close(ConnectionImplementation.java:1944)
> at
> org.apache.hadoop.hbase.mapreduce.TableInputFormatBase.close(TableInputFormatBase.java:660)
> {noformat}
> The root cause of the issue is probably at
> {{PoolMap.ThreadLocalPool.values()}}:
> {code:java}
> public Collection<R> values() {
> List<R> values = new ArrayList<>();
> values.add(get());
> return values;
> }
> {code}
> It adds {{null}} into the collection if the current thread does not have any
> resources which leads to NPE later.
> I traced the usages of values() and it should return every resource, not just
> that one which is attached to the caller thread.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)