Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-12274

Race between RegionScannerImpl#nextInternal() and RegionScannerImpl#close() may produce null pointer exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.98.6.1
    • 0.98.8, 0.99.2
    • None
    • None
    • Reviewed

    Description

      I saw the following in region server log:

      2014-10-15 03:28:36,976 ERROR [B.DefaultRpcServer.handler=0,queue=0,port=60020] ipc.RpcServer: Unexpected throwable object
      java.lang.NullPointerException
        at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextInternal(HRegion.java:5023)
        at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextRaw(HRegion.java:4932)
        at org.apache.hadoop.hbase.regionserver.HRegion$RegionScannerImpl.nextRaw(HRegion.java:4923)
        at org.apache.hadoop.hbase.regionserver.HRegionServer.scan(HRegionServer.java:3245)
        at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:29994)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2078)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:108)
        at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:114)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:94)
        at java.lang.Thread.run(Thread.java:745)
      

      This is where the NPE happened:

              // Let's see what we have in the storeHeap.
              KeyValue current = this.storeHeap.peek();
      

      The cause was race between nextInternal(called through nextRaw) and close methods.
      nextRaw() is not synchronized.

      Attachments

        1. 12274-v3.txt
          2 kB
          Ted Yu
        2. 12274-v2.txt
          2 kB
          Ted Yu
        3. 12274-v2.txt
          2 kB
          Ted Yu
        4. 12274-region-server.log
          6 kB
          Ted Yu
        5. 12274-0.98.addendum
          0.8 kB
          Ted Yu

        Activity

          People

            yuzhihong@gmail.com Ted Yu
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: