PriorityQueue isn't thread safe, KeyValueHeap uses it that way --------------------------------------------------------------
Key: HBASE-2503 URL: https://issues.apache.org/jira/browse/HBASE-2503 Project: Hadoop HBase Issue Type: Bug Affects Versions: 0.20.3 Reporter: Jean-Daniel Cryans Assignee: Jean-Daniel Cryans Priority: Critical Fix For: 0.20.5, 0.21.0 In the same spirit as HBASE-2077, but a bit different (at least to me). Dave Latham had the following NPE killing a RS: {code} Exception in thread "regionserver/192.168.41.2:60020.leaseChecker" java.lang.NullPointerException at org.apache.hadoop.hbase.regionserver.KeyValueHeap$KVScannerComparator.compare(KeyValueHeap.java:127) at org.apache.hadoop.hbase.regionserver.KeyValueHeap$KVScannerComparator.compare(KeyValueHeap.java:117) at java.util.PriorityQueue.siftDownUsingComparator(PriorityQueue.java:644) at java.util.PriorityQueue.siftDown(PriorityQueue.java:612) at java.util.PriorityQueue.poll(PriorityQueue.java:523) at org.apache.hadoop.hbase.regionserver.KeyValueHeap.close(KeyValueHeap.java:151) at org.apache.hadoop.hbase.regionserver.HRegion$RegionScanner.close(HRegion.java:1862) at org.apache.hadoop.hbase.regionserver.HRegionServer$ScannerListener.leaseExpired(HRegionServer.java:1959) at org.apache.hadoop.hbase.Leases.run(Leases.java:98) {code} He also has the same stack traces from 2077. The PQ javadoc says this class is not thread safe, but it is used by the leaseChecker thread and the client threads. We need to use something like the BlockingPriorityQueue instead. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.