hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [45/50] [abbrv] hadoop git commit: HDFS-12103: libhdfs++: Provide workaround to support cancel on filesystem connect until HDFS-11437 is resolved. Contributed by James Clampffer.
Date Thu, 22 Mar 2018 20:43:31 GMT
HDFS-12103: libhdfs++: Provide workaround to support cancel on filesystem connect until HDFS-11437
is resolved.  Contributed by James Clampffer.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e08d7866
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e08d7866
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e08d7866

Branch: refs/heads/HDFS-8707
Commit: e08d7866c9fbbfd69f966d21e0bf3e7e7b27723a
Parents: 3740495
Author: James Clampffer <james.clampffer@hp.com>
Authored: Mon Jul 10 14:23:13 2017 -0400
Committer: James Clampffer <james.clampffer@hp.com>
Committed: Thu Mar 22 16:20:45 2018 -0400

----------------------------------------------------------------------
 .../src/main/native/libhdfspp/lib/fs/filesystem.cc        | 10 ++++++----
 .../src/main/native/libhdfspp/lib/rpc/rpc_engine.cc       |  4 +++-
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e08d7866/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
index 9ef3aa0..761ff86 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
@@ -288,12 +288,14 @@ int FileSystemImpl::WorkerThreadCount() {
 }
 
 bool FileSystemImpl::CancelPendingConnect() {
-  if(!connect_callback_.IsCallbackSet()) {
-    LOG_DEBUG(kFileSystem, << "FileSystemImpl@" << this << "::CancelPendingConnect
called before Connect started");
-    return false;
-  }
   if(connect_callback_.IsCallbackAccessed()) {
+    // Temp fix for failover hangs, allow CancelPendingConnect to be called so it can push
a flag through the RPC engine
     LOG_DEBUG(kFileSystem, << "FileSystemImpl@" << this << "::CancelPendingConnect
called after Connect completed");
+    return nn_.CancelPendingConnect();
+  }
+
+  if(!connect_callback_.IsCallbackSet()) {
+    LOG_DEBUG(kFileSystem, << "FileSystemImpl@" << this << "::CancelPendingConnect
called before Connect started");
     return false;
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e08d7866/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
index 98c41da..ba55565 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
@@ -220,7 +220,9 @@ void RpcEngine::RpcCommsError(
 
     RetryAction retry = RetryAction::fail(""); // Default to fail
 
-    if (status.notWorthRetry()) {
+    if(connect_canceled_) {
+      retry = RetryAction::fail("Operation canceled");
+    } else if (status.notWorthRetry()) {
       retry = RetryAction::fail(status.ToString().c_str());
     } else if (retry_policy()) {
       retry = retry_policy()->ShouldRetry(status, req->IncrementRetryCount(), req->get_failover_count(),
true);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message