Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.0.0-alpha-1
-
None
Description
We got NPE after setting hbase.client.ipc.pool.type to thread-local:
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)
The root cause of the issue is probably at PoolMap.ThreadLocalPool.values():
public Collection<R> values() { List<R> values = new ArrayList<>(); values.add(get()); return values; }
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.