[ 
https://issues.apache.org/jira/browse/HBASE-2503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862419#action_12862419
 ] 

Jean-Daniel Cryans commented on HBASE-2503:
-------------------------------------------

Yeah might as well... And it relates even more to 2077 than I thought. So here 
if a next is waiting on a close... the result is a bit unclear to me. The user 
would see this as the end of a scan as a null would be returned by 
this.storeHeap.peek()? So adding to the sync'ed methods, I think we need a 
"closed' marker on RegionScanner that we would need to verify in next() and set 
in close().

> 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.

Reply via email to