hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1384311 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Thu, 13 Sep 2012 12:50:46 GMT
Author: mbautin
Date: Thu Sep 13 12:50:45 2012
New Revision: 1384311

URL: http://svn.apache.org/viewvc?rev=1384311&view=rev
Log:
[HBASE-6629] [0.89-fb] Fix NullPointerException in HConnectionManager

Author: michalgr

Summary: There is NullPointerException that is thrown from time to time in HConnectionManager

Test Plan:
TestMasterTransitions#testRegionCloseWhenNoMetaHBase2428 was failing with NullPointerException
every time I run it locally, and occasionally when run in map reduce. Now it passes.

I will run all tests in map reduce to see if it fixes more tests.

Reviewers: aaiyer

Reviewed By: aaiyer

CC: Karthik

Differential Revision: https://reviews.facebook.net/D5349

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1384311&r1=1384310&r2=1384311&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Thu Sep 13 12:50:45 2012
@@ -1582,7 +1582,10 @@ public class HConnectionManager {
       if (fInfo == null) {
         fInfo = new FailureInfo();
         fInfo.timeOfFirstFailureMilliSec = currentTime;
-        fInfo = repeatedFailuresMap.putIfAbsent(server, fInfo);
+        FailureInfo oldfInfo = repeatedFailuresMap.putIfAbsent(server, fInfo);
+        if (oldfInfo != null) {
+          fInfo = oldfInfo;
+        }
       }
       fInfo.timeOfLatestAttemptMilliSec = currentTime;
       fInfo.numConsecutiveFailures.incrementAndGet();



Mime
View raw message