[
https://issues.apache.org/jira/browse/HBASE-24158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17084959#comment-17084959
]
Michael Stack commented on HBASE-24158:
---------------------------------------
Pushed below addendum to branch-2.2+
{code}
commit 50f5cf1f94a10b14fd3def2aab495682128d1816 (HEAD -> 2.2, origin/branch-2.2)
Author: stack <[email protected]>
Date: Thu Apr 16 08:02:33 2020 -0700
HBASE-24158 [Flakey Tests] TestAsyncTableGetMultiThreaded
Addendum to address NPE
diff --git
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java
index 764650afba..4c6cd5a011 100644
---
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java
+++
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRegionLocatorHelper.java
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,7 +19,6 @@ package org.apache.hadoop.hbase.client;
import static
org.apache.hadoop.hbase.exceptions.ClientExceptionsUtil.findException;
import static
org.apache.hadoop.hbase.exceptions.ClientExceptionsUtil.isMetaClearingException;
-
import java.util.Arrays;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -45,7 +44,13 @@ final class AsyncRegionLocatorHelper {
static boolean canUpdateOnError(HRegionLocation loc, HRegionLocation oldLoc)
{
// Do not need to update if no such location, or the location is newer, or
the location is not
// the same with us
- return oldLoc != null && oldLoc.getSeqNum() <= loc.getSeqNum() &&
+ if (loc == null || loc.getServerName() == null) {
+ return false;
+ }
+ if (oldLoc == null || oldLoc.getServerName() == null) {
+ return false;
+ }
+ return oldLoc.getSeqNum() <= loc.getSeqNum() &&
oldLoc.getServerName().equals(loc.getServerName());
}
{code}
> [Flakey Tests] TestAsyncTableGetMultiThreaded
> ---------------------------------------------
>
> Key: HBASE-24158
> URL: https://issues.apache.org/jira/browse/HBASE-24158
> Project: HBase
> Issue Type: Bug
> Reporter: Michael Stack
> Assignee: Michael Stack
> Priority: Major
> Fix For: 3.0.0, 2.3.0
>
> Attachments:
> 0001-HBASE-24158-Flakey-Tests-TestAsyncTableGetMultiThrea.patch,
> 0001-HBASE-24158-Flakey-Tests-TestAsyncTableGetMultiThrea.patch
>
>
> I've already cut down the number of threads used by this test but it failed
> in nightly last night unable to close out its xml and locally it failed too
> in a run overnight. I ran it under harness and it seems well-behaved. It
> doesn't use much memory -- 700MB -- and thread counts are usual (~450). It
> does use near 100% CPU which is a little unusual. Otherwise, looks fine.
> Let me keep an eye on it. Could down the thread count more and use less
> processes... this makes it use less CPU. There does seems a bunch of overlap
> with tests done elsewhere.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)