Skip to content

HDDS-2107. Datanodes should retry forever to connect to SCM in an… #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.retry.RetryPolicies;
import org.apache.hadoop.io.retry.RetryPolicy;
import org.apache.hadoop.ipc.ProtobufRpcEngine;
import org.apache.hadoop.ipc.RPC;
import org.apache.hadoop.metrics2.util.MBeans;
Expand All @@ -38,6 +40,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

Expand Down Expand Up @@ -139,10 +142,14 @@ public void addSCMServer(InetSocketAddress address) throws IOException {
long version =
RPC.getProtocolVersion(StorageContainerDatanodeProtocolPB.class);

StorageContainerDatanodeProtocolPB rpcProxy = RPC.getProxy(
RetryPolicy retryPolicy =
RetryPolicies.retryForeverWithFixedSleep(
1000, TimeUnit.MILLISECONDS);
StorageContainerDatanodeProtocolPB rpcProxy = RPC.getProtocolProxy(
StorageContainerDatanodeProtocolPB.class, version,
address, UserGroupInformation.getCurrentUser(), conf,
NetUtils.getDefaultSocketFactory(conf), getRpcTimeout());
NetUtils.getDefaultSocketFactory(conf), getRpcTimeout(),
retryPolicy).getProxy();

StorageContainerDatanodeProtocolClientSideTranslatorPB rpcClient =
new StorageContainerDatanodeProtocolClientSideTranslatorPB(rpcProxy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void stop() {
* transactions or not.
* @throws Exception
*/
@Test(timeout = 300_000)
@Test(timeout = 500_000)
public void testDoubleBuffer() throws Exception {
// This test checks whether count in tables are correct or not.
testDoubleBuffer(1, 10);
Expand Down Expand Up @@ -397,7 +397,7 @@ public void testDoubleBuffer(int iterations, int bucketCount)
}
return count == iterations;

}, 300, 40000);
}, 300, 300000);


GenericTestUtils.waitFor(() -> {
Expand All @@ -409,7 +409,7 @@ public void testDoubleBuffer(int iterations, int bucketCount)
fail("testDoubleBuffer failed");
}
return count == bucketCount * iterations;
}, 300, 40000);
}, 300, 300000);

Assert.assertTrue(doubleBuffer.getFlushIterations() > 0);
} finally {
Expand Down