HDFS-6015. Fix TestBlockRecovery#testRaceBetweenReplicaRecoveryAndFinalizeBlock. Contributed by Kihwal Lee.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-5535@1571785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f52fe68a2b
commit
6780b086d8
@ -90,3 +90,6 @@ HDFS-5535 subtasks:
|
||||
usage message. (Vinayakumar B via szetszwo)
|
||||
|
||||
HDFS-6014. Fix findbug warnings introduced by HDFS-5583. (kihwal)
|
||||
|
||||
HDFS-6015. Fix TestBlockRecovery
|
||||
#testRaceBetweenReplicaRecoveryAndFinalizeBlock. (kihwal)
|
||||
|
@ -761,7 +761,13 @@ void receiveBlock(
|
||||
}
|
||||
if (responder != null) {
|
||||
try {
|
||||
responder.join(datanode.getDnConf().getXceiverStopTimeout());
|
||||
responder.interrupt();
|
||||
// join() on the responder should timeout a bit earlier than the
|
||||
// configured deadline. Otherwise, the join() on this thread will
|
||||
// likely timeout as well.
|
||||
long joinTimeout = datanode.getDnConf().getXceiverStopTimeout();
|
||||
joinTimeout = joinTimeout > 1 ? joinTimeout*8/10 : joinTimeout;
|
||||
responder.join(joinTimeout);
|
||||
if (responder.isAlive()) {
|
||||
String msg = "Join on responder thread " + responder
|
||||
+ " timed out";
|
||||
|
@ -586,6 +586,7 @@ public void testRaceBetweenReplicaRecoveryAndFinalizeBlock() throws Exception {
|
||||
tearDown();// Stop the Mocked DN started in startup()
|
||||
|
||||
Configuration conf = new HdfsConfiguration();
|
||||
conf.set(DFSConfigKeys.DFS_DATANODE_XCEIVER_STOP_TIMEOUT_MILLIS_KEY, "1000");
|
||||
MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
|
||||
.nnTopology(MiniDFSNNTopology.simpleSingleNN(8020, 50070))
|
||||
.numDataNodes(1).build();
|
||||
|
Loading…
Reference in New Issue
Block a user