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 <ashugpt@amazon.com>
This commit is contained in:
parent
ef36457b53
commit
cbdabe9ec8
@ -88,8 +88,9 @@ public ProbeStatus ping(ComponentInstance instance) {
|
||||
}
|
||||
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 ProbeStatus ping(ComponentInstance instance) {
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user