HBase
  1. HBase
  2. HBASE-5097

RegionObserver implementation whose preScannerOpen and postScannerOpen Impl return null can stall the system initialization through NPE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.92.2, 0.94.0, 0.95.0
    • Component/s: Coprocessors
    • Labels:
      None

      Description

      In HRegionServer.java openScanner()

            r.prepareScanner(scan);
            RegionScanner s = null;
            if (r.getCoprocessorHost() != null) {
              s = r.getCoprocessorHost().preScannerOpen(scan);
            }
            if (s == null) {
              s = r.getScanner(scan);
            }
            if (r.getCoprocessorHost() != null) {
              s = r.getCoprocessorHost().postScannerOpen(scan, s);
            }
      

      If we dont have implemention for postScannerOpen the RegionScanner is null and so throwing nullpointer

      java.lang.NullPointerException
      	at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
      	at org.apache.hadoop.hbase.regionserver.HRegionServer.addScanner(HRegionServer.java:2282)
      	at org.apache.hadoop.hbase.regionserver.HRegionServer.openScanner(HRegionServer.java:2272)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.call(WritableRpcEngine.java:364)
      	at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1326)
      
      

      Making this defect as blocker.. Pls feel free to change the priority if am wrong. Also correct me if my way of trying out coprocessors without implementing postScannerOpen is wrong. Am just a learner.

      1. HBASE-5097_2.patch
        0.9 kB
        ramkrishna.s.vasudevan
      2. HBASE-5097_1.patch
        0.8 kB
        ramkrishna.s.vasudevan
      3. HBASE-5097.patch
        1 kB
        ramkrishna.s.vasudevan

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            ramkrishna.s.vasudevan
            Reporter:
            ramkrishna.s.vasudevan
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development