@@ -2431,12 +2431,13 @@ public void abort(String reason, Throwable cause) {
2431
2431
msg += "\n Cause:\n " + Throwables .getStackTraceAsString (cause );
2432
2432
}
2433
2433
// Report to the master but only if we have already registered with the master.
2434
- if (rssStub != null && this .serverName != null ) {
2434
+ RegionServerStatusService .BlockingInterface rss = rssStub ;
2435
+ if (rss != null && this .serverName != null ) {
2435
2436
ReportRSFatalErrorRequest .Builder builder =
2436
2437
ReportRSFatalErrorRequest .newBuilder ();
2437
2438
builder .setServer (ProtobufUtil .toServerName (this .serverName ));
2438
2439
builder .setErrorMessage (msg );
2439
- rssStub .reportRSFatalError (null , builder .build ());
2440
+ rss .reportRSFatalError (null , builder .build ());
2440
2441
}
2441
2442
} catch (Throwable t ) {
2442
2443
LOG .warn ("Unable to report fatal error to master" , t );
@@ -2645,7 +2646,8 @@ private boolean keepLooping() {
2645
2646
private RegionServerStartupResponse reportForDuty () throws IOException {
2646
2647
if (this .masterless ) return RegionServerStartupResponse .getDefaultInstance ();
2647
2648
ServerName masterServerName = createRegionServerStatusStub (true );
2648
- if (masterServerName == null ) return null ;
2649
+ RegionServerStatusService .BlockingInterface rss = rssStub ;
2650
+ if (masterServerName == null || rss == null ) return null ;
2649
2651
RegionServerStartupResponse result = null ;
2650
2652
try {
2651
2653
rpcServices .requestCount .reset ();
@@ -2664,7 +2666,7 @@ private RegionServerStartupResponse reportForDuty() throws IOException {
2664
2666
request .setPort (port );
2665
2667
request .setServerStartCode (this .startcode );
2666
2668
request .setServerCurrentTime (now );
2667
- result = this . rssStub .regionServerStartup (null , request .build ());
2669
+ result = rss .regionServerStartup (null , request .build ());
2668
2670
} catch (ServiceException se ) {
2669
2671
IOException ioe = ProtobufUtil .getRemoteException (se );
2670
2672
if (ioe instanceof ClockOutOfSyncException ) {
0 commit comments