knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pzamp...@apache.org
Subject knox git commit: KNOX-1436 - AbstractHdfsHaDispatch failoverRequest - Improve Failover Logging
Date Thu, 27 Sep 2018 17:56:15 GMT
Repository: knox
Updated Branches:
  refs/heads/master c4f946382 -> c8635c55a


KNOX-1436 - AbstractHdfsHaDispatch failoverRequest - Improve Failover Logging

Signed-off-by: Phil Zampino <pzampino@apache.org>


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

Branch: refs/heads/master
Commit: c8635c55ac7d59e1bc780c75d634ece59d75c793
Parents: c4f9463
Author: MatthewSharp <Matthew.Sharp@Target.com>
Authored: Thu Sep 6 08:33:24 2018 -0400
Committer: Phil Zampino <pzampino@apache.org>
Committed: Thu Sep 27 13:38:58 2018 -0400

----------------------------------------------------------------------
 .../apache/knox/gateway/ha/dispatch/i18n/HaDispatchMessages.java  | 3 +++
 .../apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/c8635c55/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/dispatch/i18n/HaDispatchMessages.java
----------------------------------------------------------------------
diff --git a/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/dispatch/i18n/HaDispatchMessages.java
b/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/dispatch/i18n/HaDispatchMessages.java
index 7bbb1ea..d597c47 100644
--- a/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/dispatch/i18n/HaDispatchMessages.java
+++ b/gateway-provider-ha/src/main/java/org/apache/knox/gateway/ha/dispatch/i18n/HaDispatchMessages.java
@@ -33,6 +33,9 @@ public interface HaDispatchMessages {
   @Message(level = MessageLevel.INFO, text = "Failing over request to a different server:
{0}")
   void failingOverRequest(String uri);
 
+  @Message(level = MessageLevel.INFO, text = "Failed to connect to: {0}")
+  void failedToConnectTo(String uri);
+
   @Message(level = MessageLevel.INFO, text = "Maximum attempts {0} to failover reached for
service: {1}")
   void maxFailoverAttemptsReached(int attempts, String service);
 

http://git-wip-us.apache.org/repos/asf/knox/blob/c8635c55/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
b/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
index 595c784..37e146a 100644
--- a/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
+++ b/gateway-service-webhdfs/src/main/java/org/apache/knox/gateway/hdfs/dispatch/AbstractHdfsHaDispatch.java
@@ -111,7 +111,7 @@ public abstract class AbstractHdfsHaDispatch extends HdfsHttpClientDispatch
{
    }
 
   private void failoverRequest(HttpUriRequest outboundRequest, HttpServletRequest inboundRequest,
HttpServletResponse outboundResponse, HttpResponse inboundResponse, Exception exception) throws
IOException {
-      LOG.failingOverRequest(outboundRequest.getURI().toString());
+      LOG.failedToConnectTo(outboundRequest.getURI().toString());
       AtomicInteger counter = (AtomicInteger) inboundRequest.getAttribute(FAILOVER_COUNTER_ATTRIBUTE);
       if (counter == null) {
          counter = new AtomicInteger(0);
@@ -130,6 +130,7 @@ public abstract class AbstractHdfsHaDispatch extends HdfsHttpClientDispatch
{
                LOG.failoverSleepFailed(getResourceRole(), e);
             }
          }
+         LOG.failingOverRequest(outboundRequest.getURI().toString());
          executeRequest(outboundRequest, inboundRequest, outboundResponse);
       } else {
          LOG.maxFailoverAttemptsReached(maxFailoverAttempts, getResourceRole());


Mime
View raw message