hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asur...@apache.org
Subject [39/50] [abbrv] hadoop git commit: HADOOP-12901. Add warning log when KMSClientProvider cannot create a connection to the KMS server. (Xiao Chen via wang)
Date Tue, 08 Mar 2016 19:06:40 GMT
HADOOP-12901. Add warning log when KMSClientProvider cannot create a connection to the KMS
server. (Xiao Chen via wang)


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

Branch: refs/heads/yarn-2877
Commit: 391da36d93358038c50c15d91543f6c765fa0471
Parents: 724d229
Author: Andrew Wang <wang@apache.org>
Authored: Mon Mar 7 14:00:02 2016 -0800
Committer: Andrew Wang <wang@apache.org>
Committed: Mon Mar 7 14:00:02 2016 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/crypto/key/kms/KMSClientProvider.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/391da36d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
index 7682888..b894c7f 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
@@ -42,6 +42,8 @@ import org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthentica
 import org.apache.hadoop.util.HttpExceptionUtils;
 import org.apache.http.client.utils.URIBuilder;
 import org.codehaus.jackson.map.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.net.ssl.HttpsURLConnection;
 
@@ -85,6 +87,9 @@ import com.google.common.base.Strings;
 public class KMSClientProvider extends KeyProvider implements CryptoExtension,
     KeyProviderDelegationTokenExtension.DelegationTokenExtension {
 
+  private static final Logger LOG =
+      LoggerFactory.getLogger(KMSClientProvider.class);
+
   private static final String INVALID_SIGNATURE = "Invalid signature";
 
   private static final String ANONYMOUS_REQUESTS_DISALLOWED = "Anonymous requests are disallowed";
@@ -491,6 +496,9 @@ public class KMSClientProvider extends KeyProvider implements CryptoExtension,
         }
       });
     } catch (IOException ex) {
+      if (ex instanceof SocketTimeoutException) {
+        LOG.warn("Failed to connect to {}:{}", url.getHost(), url.getPort());
+      }
       throw ex;
     } catch (UndeclaredThrowableException ex) {
       throw new IOException(ex.getUndeclaredThrowable());


Mime
View raw message