You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by pr...@apache.org on 2022/06/22 04:08:36 UTC

[hadoop] branch trunk updated: YARN-9971.YARN Native Service HttpProbe logs THIS_HOST in error messages (#4436)

This is an automated email from the ASF dual-hosted git repository.

prabhujoseph pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new cbdabe9ec80 YARN-9971.YARN Native Service HttpProbe logs THIS_HOST in error messages (#4436)
cbdabe9ec80 is described below

commit cbdabe9ec80ec82ba1ca9e537611e27567b80dc9
Author: Ashutosh Gupta <as...@st.niituniversity.in>
AuthorDate: Wed Jun 22 05:08:19 2022 +0100

    YARN-9971.YARN Native Service HttpProbe logs THIS_HOST in error messages (#4436)
    
    * YARN-9971.YARN Native Service HttpProbe logs THIS_HOST in error messages
    
    Co-authored-by: Ashutosh Gupta <as...@amazon.com>
---
 .../org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java
index 492a11b2c67..40a87937629 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/monitor/probe/HttpProbe.java
@@ -88,8 +88,9 @@ public class HttpProbe extends DefaultProbe {
     }
     String ip = instance.getContainerStatus().getIPs().get(0);
     HttpURLConnection connection = null;
+    String hostString = urlString.replace(HOST_TOKEN, ip);
     try {
-      URL url = new URL(urlString.replace(HOST_TOKEN, ip));
+      URL url = new URL(hostString);
       connection = getConnection(url, this.timeout);
       int rc = connection.getResponseCode();
       if (rc < min || rc > max) {
@@ -101,7 +102,8 @@ public class HttpProbe extends DefaultProbe {
         status.succeed(this);
       }
     } catch (Throwable e) {
-      String error = "Probe " + urlString + " failed for IP " + ip + ": " + e;
+      String error =
+          "Probe " + hostString + " failed for IP " + ip + ": " + e;
       log.info(error, e);
       status.fail(this,
           new IOException(error, e));


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