Skip to content

Commit cafa4b3

Browse files
authored
TEZ-4357: Report url to logs in case of fetcher connection failure (#169). (Laszlo Bodor, reviewed by Ayush Saxena)
1 parent d8dda5c commit cafa4b3

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/Fetcher.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,9 @@ protected HostFetchResult doHttpFetch() {
494494
}
495495

496496
private HostFetchResult setupConnection(Collection<InputAttemptIdentifier> attempts) {
497+
StringBuilder baseURI = null;
497498
try {
498-
StringBuilder baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host,
499+
baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host,
499500
port, partition, partitionCount, appId.toString(), dagIdentifier, httpConnectionParams.isSslShuffle());
500501
this.url = ShuffleUtils.constructInputURL(baseURI.toString(), attempts,
501502
httpConnectionParams.isKeepAlive());
@@ -547,9 +548,8 @@ private HostFetchResult setupConnection(Collection<InputAttemptIdentifier> attem
547548
}
548549
} else {
549550
InputAttemptIdentifier firstAttempt = attempts.iterator().next();
550-
LOG.warn(String.format(
551-
"Fetch Failure while connecting from %s to: %s:%d, attempt: %s Informing ShuffleManager: ",
552-
localHostname, host, port, firstAttempt), e);
551+
LOG.warn("FETCH_FAILURE: Fetch Failure while connecting from {} to: {}:{}, attempt: {}, url: {}"
552+
+ " Informing ShuffleManager", localHostname, host, port, firstAttempt, baseURI, e);
553553
return new HostFetchResult(new FetchResult(host, port, partition, partitionCount, srcAttemptsRemaining.values()),
554554
new InputAttemptFetchFailure[] { new InputAttemptFetchFailure(firstAttempt) }, true);
555555
}

tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/FetcherOrderedGrouped.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@ private void invokeCopyFailedForFailedTasks(MapHost host,
340340
boolean setupConnection(MapHost host, Collection<InputAttemptIdentifier> attempts)
341341
throws IOException {
342342
boolean connectSucceeded = false;
343+
StringBuilder baseURI = null;
343344
try {
344-
StringBuilder baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host.getHost(),
345+
baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host.getHost(),
345346
host.getPort(), host.getPartitionId(), host.getPartitionCount(), applicationId, dagId, sslShuffle);
346347
URL url = ShuffleUtils.constructInputURL(baseURI.toString(), attempts, httpConnectionParams.isKeepAlive());
347348
httpConnection = ShuffleUtils.getHttpConnection(asyncHttp, url, httpConnectionParams,
@@ -364,13 +365,13 @@ boolean setupConnection(MapHost host, Collection<InputAttemptIdentifier> attempt
364365
}
365366
ioErrs.increment(1);
366367
if (!connectSucceeded) {
367-
LOG.warn(String.format("Failed to connect from %s to %s with %d inputs", localShuffleHost,
368-
host, remaining.size()), ie);
368+
LOG.warn("FETCH_FAILURE: Failed to connect from {} to {} with {} inputs, url: {}", localShuffleHost,
369+
host, remaining.size(), baseURI, ie);
369370
connectionErrs.increment(1);
370371
} else {
371-
LOG.warn(String.format(
372-
"Failed to verify reply after connecting from %s to %s with %d inputs pending",
373-
localShuffleHost, host, remaining.size()), ie);
372+
LOG.warn(
373+
"FETCH_FAILURE: Failed to verify reply after connecting from {} to {} with {} inputs pending, url: {}",
374+
localShuffleHost, host, remaining.size(), baseURI, ie);
374375
}
375376

376377
// At this point, either the connection failed, or the initial header verification failed.

0 commit comments

Comments
 (0)