Skip to content

Commit

Permalink
Merge pull request #436 from squarY/timeoutfix
Browse files Browse the repository at this point in the history
Fix: Extend the timeout of admin request
  • Loading branch information
Yan committed Aug 10, 2016
2 parents fdd2ca9 + bdb660a commit c7b4c1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Expand Up @@ -119,10 +119,11 @@ public void run() throws Exception {
dataDir, e);
}

// While processing an admin request, HDFSFailedLock could take long time because of multiple HDFS operations,
// especially when the name node is in a different data center. So extend timeout to 5 minutes.
AdminClientConfig adminConfig = new AdminClientConfig().setMaxConnectionsPerNode(cluster.getNumberOfNodes())
.setAdminConnectionTimeoutSec(15)
.setMaxBackoffDelayMs(maxBackoffDelayMs)
.setAdminSocketTimeoutSec(60);
.setAdminSocketTimeoutSec(60 * 5);

ClientConfig clientConfig = new ClientConfig().setBootstrapUrls(cluster.getBootStrapUrls())
.setConnectionTimeout(httpTimeoutMs,
Expand Down
Expand Up @@ -199,6 +199,7 @@ private void handleIOException(IOException e, String action, int attempt)

@Override
public synchronized void acquireLock() throws Exception {
logger.info("Try to acquire HDFS distributed lock.");
if (lockAcquired) {
logger.info("HdfsFailedFetchLock.acquireLock() called while it is already acquired!");
return;
Expand Down Expand Up @@ -236,6 +237,7 @@ public synchronized void acquireLock() throws Exception {
if (!this.lockAcquired) {
throw new VoldemortException(exceptionMessage(ACQUIRE_LOCK));
}
logger.info("HDFS distributed lock acquired.");
}

@Override
Expand Down
Expand Up @@ -2083,6 +2083,7 @@ private Message handleFetchFailure(VAdminProto.HandleFetchFailureRequest handleF
for (Integer nodeId: nodesFailedInThisFetch) {
logger.warn("Will disable store '" + storeName + "' on node " + nodeId);
distributedLock.addDisabledNode(nodeId, storeName, pushVersion);
logger.warn("Store '" + storeName + "' is disabled on node " + nodeId);
if (firstNode) {
firstNode = false;
} else {
Expand Down

0 comments on commit c7b4c1b

Please sign in to comment.