hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Kellerman (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-435) TestTableMapReduce failed in HBase-Patch #15
Date Sun, 10 Feb 2008 07:30:08 GMT

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

Jim Kellerman commented on HBASE-435:
-------------------------------------

In MultiRegionTable.makeMultiRegionTable, it is possible to run out of retries in the following
loop and exit the loop with a null HRegion:

    HRegion r = null;
    for (int i = 0; i < 30; i++) {
      hri = t.getRegionLocation(HConstants.EMPTY_START_ROW).getRegionInfo();
      LOG.info("Region location: " + hri);
      r = cluster.getRegionThreads().get(0).getRegionServer().
        onlineRegions.get(hri.getRegionName());
      if (r != null) {
        break;
      }
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        LOG.warn("Waiting on region to come online", e);
      }
    }

    // Flush the cache
    cluster.getRegionThreads().get(0).getRegionServer().getCacheFlushListener().
      flushRequested(r);

If you fall out of the loop after 30 retries, r is null and so you get the NPE from inside
of flushRequested which is trying to do:

      QueueEntry e = new QueueEntry(region, System.currentTimeMillis());
      synchronized (flushQueue) {
        if (flushQueue.contains(e)) {

QueueEntry.equals is based on the its hashCode which is computed by:

    public int hashCode() {
      return this.region.getRegionInfo().hashCode();
    }

So if region is null, dereferencing it will generate the NPE

> TestTableMapReduce failed in HBase-Patch #15
> --------------------------------------------
>
>                 Key: HBASE-435
>                 URL: https://issues.apache.org/jira/browse/HBASE-435
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 0.2.0
>            Reporter: Jim Kellerman
>
> TestTableMapReduce failed in HBase-Patch #15 see: http://hudson.zones.apache.org/hudson/job/HBase-Patch/15/testReport/
> java.lang.NullPointerException
> 	at org.apache.hadoop.hbase.HRegionServer$QueueEntry.hashCode(HRegionServer.java:187)
> 	at org.apache.hadoop.hbase.HRegionServer$QueueEntry.equals(HRegionServer.java:181)
> 	at java.util.AbstractCollection.contains(AbstractCollection.java:101)
> 	at org.apache.hadoop.hbase.HRegionServer$Flusher.flushRequested(HRegionServer.java:494)
> 	at org.apache.hadoop.hbase.MultiRegionTable.makeMultiRegionTable(MultiRegionTable.java:107)
> 	at org.apache.hadoop.hbase.mapred.TestTableMapReduce.localTestMultiRegionTable(TestTableMapReduce.java:284)
> 	at org.apache.hadoop.hbase.mapred.TestTableMapReduce.testTableMapReduce(TestTableMapReduce.java:205)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message