You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2013/04/23 05:23:32 UTC
svn commit: r1470800 -
/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
Author: tedyu
Date: Tue Apr 23 03:23:32 2013
New Revision: 1470800
URL: http://svn.apache.org/r1470800
Log:
HBASE-8389 HBASE-8354 DDoSes Namenode with lease recovery requests (Varun and Ted)
Modified:
hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java?rev=1470800&r1=1470799&r2=1470800&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/util/FSHDFSUtils.java Tue Apr 23 03:23:32 2013
@@ -73,6 +73,9 @@ public class FSHDFSUtils extends FSUtils
long recoveryTimeout = conf.getInt("hbase.lease.recovery.timeout", 300000);
// conf parameter passed from unit test, indicating whether fs.append() should be triggered
boolean triggerAppend = conf.getBoolean(TEST_TRIGGER_DFS_APPEND, false);
+ // retrying lease recovery may preempt pending lease recovery; default to waiting for 4 seconds
+ // after calling recoverLease
+ int waitingPeriod = conf.getInt("hbase.lease.recovery.waiting.period", 4000);
Exception ex = null;
while (!recovered) {
try {
@@ -123,13 +126,15 @@ public class FSHDFSUtils extends FSUtils
}
}
try {
- Thread.sleep(1000);
+ Thread.sleep(waitingPeriod);
} catch (InterruptedException ie) {
InterruptedIOException iioe = new InterruptedIOException();
iioe.initCause(ie);
throw iioe;
}
+ // we keep original behavior without retrying lease recovery
+ break;
}
- LOG.info("Finished lease recover attempt for " + p);
+ LOG.info("Finished lease recovery attempt for " + p);
}
}