You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2020/05/12 03:50:50 UTC
[hbase] branch branch-2 updated: HBASE-24338 [Flakey Tests] NPE in
TestRaceBetweenSCPAndDTP Addendum2: make same fix for
TestRaceBetweenSCPAndTRSP but in a second place (addendum 1 got first
place).
This is an automated email from the ASF dual-hosted git repository.
stack pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2 by this push:
new 5c08a8c HBASE-24338 [Flakey Tests] NPE in TestRaceBetweenSCPAndDTP Addendum2: make same fix for TestRaceBetweenSCPAndTRSP but in a second place (addendum 1 got first place).
5c08a8c is described below
commit 5c08a8c04bf80490ba8a29779f8c906349771dd0
Author: stack <st...@apache.org>
AuthorDate: Mon May 11 20:47:23 2020 -0700
HBASE-24338 [Flakey Tests] NPE in TestRaceBetweenSCPAndDTP Addendum2: make same fix for TestRaceBetweenSCPAndTRSP but in a second place (addendum 1 got first place).
---
.../hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java
index e1ba68c..a1b25e0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/assignment/TestRaceBetweenSCPAndTRSP.java
@@ -133,19 +133,20 @@ public class TestRaceBetweenSCPAndTRSP {
AssignmentManager am = UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager();
ServerName sn = am.getRegionStates().getRegionState(region).getServerName();
+ // Assign the CountDownLatches that get nulled in background threads else we NPE checking
+ // the static.
ARRIVE_REGION_OPENING = new CountDownLatch(1);
+ CountDownLatch arriveRegionOpening = ARRIVE_REGION_OPENING;
RESUME_REGION_OPENING = new CountDownLatch(1);
- // Assign to local variable because this static gets set to null in above running thread and
- // so can NPE when we check await later below.
ARRIVE_GET_REGIONS_ON_SERVER = new CountDownLatch(1);
- CountDownLatch cdl = ARRIVE_GET_REGIONS_ON_SERVER;
+ CountDownLatch arriveGetRegionsOnServer = ARRIVE_GET_REGIONS_ON_SERVER;
RESUME_GET_REGIONS_ON_SERVER = new CountDownLatch(1);
Future<byte[]> moveFuture = am.moveAsync(new RegionPlan(region, sn, sn));
- ARRIVE_REGION_OPENING.await();
+ arriveRegionOpening.await();
UTIL.getMiniHBaseCluster().killRegionServer(sn);
- cdl.await();
+ arriveGetRegionsOnServer.await();
RESUME_REGION_OPENING.countDown();
moveFuture.get();