From 26de676dea8b829c4fe746da4f06bc4a4cd6c3aa Mon Sep 17 00:00:00 2001 From: ramkrishna Date: Thu, 29 Mar 2012 18:34:02 +0000 Subject: [PATCH] HBASE-5097 RegionObserver implementation whose preScannerOpen and postScannerOpen Impl return null can stall the system initialization through NPE (Ram) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1307036 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/hadoop/hbase/regionserver/HRegionServer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 90cf3a3c92f..9c215b456bb 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -2326,7 +2326,14 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler, s = r.getScanner(scan); } if (r.getCoprocessorHost() != null) { - s = r.getCoprocessorHost().postScannerOpen(scan, s); + RegionScanner savedScanner = r.getCoprocessorHost().postScannerOpen( + scan, s); + if (savedScanner == null) { + LOG.warn("PostScannerOpen impl returning null. " + + "Check the RegionObserver implementation."); + } else { + s = savedScanner; + } } return addScanner(s); } catch (Throwable t) {