[ 
https://issues.apache.org/jira/browse/HBASE-16402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Purtell updated HBASE-16402:
-----------------------------------
    Description: 
We found NPE in our 0.98 production cluster because RegionServerCoprocessorHost 
is not initialized before RpcServer start service.

{code}
      // Try and register with the Master; tell it we are here.  Break if
      // server is stopped or the clusterup flag is down or hdfs went wacky.
      while (keepLooping()) {
        RegionServerStartupResponse w = reportForDuty();
        if (w == null) {
          LOG.warn("reportForDuty failed; sleeping and then retrying.");
          this.sleeper.sleep();
        } else {
          handleReportForDutyResponse(w);
          break;
        }
      }

      // Initialize the RegionServerCoprocessorHost now that our ephemeral
      // node was created by reportForDuty, in case any coprocessors want
      // to use ZooKeeper
      this.rsHost = new RegionServerCoprocessorHost(this, this.conf);
{code}

RpcServer start service in handleReportForDutyResponse(), then it can serve rpc 
call replicateWALEntry(). But the RegionServerCoprocessorHost is not 
initialized and it is used in replicateWALEntry, so it will throw a NPE.


  was:
>From [~zghaobac] on HBASE-10338

{quote}

We found NPE in our 0.98 production cluster because RegionServerCoprocessorHost 
is not initialized before RpcServer start service.

{code}
      // Try and register with the Master; tell it we are here.  Break if
      // server is stopped or the clusterup flag is down or hdfs went wacky.
      while (keepLooping()) {
        RegionServerStartupResponse w = reportForDuty();
        if (w == null) {
          LOG.warn("reportForDuty failed; sleeping and then retrying.");
          this.sleeper.sleep();
        } else {
          handleReportForDutyResponse(w);
          break;
        }
      }

      // Initialize the RegionServerCoprocessorHost now that our ephemeral
      // node was created by reportForDuty, in case any coprocessors want
      // to use ZooKeeper
      this.rsHost = new RegionServerCoprocessorHost(this, this.conf);
{code}

RpcServer start service in handleReportForDutyResponse(), then it can serve rpc 
call replicateWALEntry(). But the RegionServerCoprocessorHost is not 
initialized and it is used in replicateWALEntry, so it will throw a NPE.

{quote}



> RegionServerCoprocessorHost should be initialized before RpcServer starts
> -------------------------------------------------------------------------
>
>                 Key: HBASE-16402
>                 URL: https://issues.apache.org/jira/browse/HBASE-16402
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Guanghao Zhang
>             Fix For: 0.98.22
>
>         Attachments: HBASE-16402-0.98.patch
>
>
> We found NPE in our 0.98 production cluster because 
> RegionServerCoprocessorHost is not initialized before RpcServer start service.
> {code}
>       // Try and register with the Master; tell it we are here.  Break if
>       // server is stopped or the clusterup flag is down or hdfs went wacky.
>       while (keepLooping()) {
>         RegionServerStartupResponse w = reportForDuty();
>         if (w == null) {
>           LOG.warn("reportForDuty failed; sleeping and then retrying.");
>           this.sleeper.sleep();
>         } else {
>           handleReportForDutyResponse(w);
>           break;
>         }
>       }
>       // Initialize the RegionServerCoprocessorHost now that our ephemeral
>       // node was created by reportForDuty, in case any coprocessors want
>       // to use ZooKeeper
>       this.rsHost = new RegionServerCoprocessorHost(this, this.conf);
> {code}
> RpcServer start service in handleReportForDutyResponse(), then it can serve 
> rpc call replicateWALEntry(). But the RegionServerCoprocessorHost is not 
> initialized and it is used in replicateWALEntry, so it will throw a NPE.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to