Skip to content

Commit

Permalink
TEZ-4357: Report url to logs in case of fetcher connection failure (#169
Browse files Browse the repository at this point in the history
). (Laszlo Bodor, reviewed by Ayush Saxena)
  • Loading branch information
abstractdog authored Jan 25, 2024
1 parent d8dda5c commit cafa4b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,9 @@ protected HostFetchResult doHttpFetch() {
}

private HostFetchResult setupConnection(Collection<InputAttemptIdentifier> attempts) {
StringBuilder baseURI = null;
try {
StringBuilder baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host,
baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host,
port, partition, partitionCount, appId.toString(), dagIdentifier, httpConnectionParams.isSslShuffle());
this.url = ShuffleUtils.constructInputURL(baseURI.toString(), attempts,
httpConnectionParams.isKeepAlive());
Expand Down Expand Up @@ -547,9 +548,8 @@ private HostFetchResult setupConnection(Collection<InputAttemptIdentifier> attem
}
} else {
InputAttemptIdentifier firstAttempt = attempts.iterator().next();
LOG.warn(String.format(
"Fetch Failure while connecting from %s to: %s:%d, attempt: %s Informing ShuffleManager: ",
localHostname, host, port, firstAttempt), e);
LOG.warn("FETCH_FAILURE: Fetch Failure while connecting from {} to: {}:{}, attempt: {}, url: {}"
+ " Informing ShuffleManager", localHostname, host, port, firstAttempt, baseURI, e);
return new HostFetchResult(new FetchResult(host, port, partition, partitionCount, srcAttemptsRemaining.values()),
new InputAttemptFetchFailure[] { new InputAttemptFetchFailure(firstAttempt) }, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,9 @@ private void invokeCopyFailedForFailedTasks(MapHost host,
boolean setupConnection(MapHost host, Collection<InputAttemptIdentifier> attempts)
throws IOException {
boolean connectSucceeded = false;
StringBuilder baseURI = null;
try {
StringBuilder baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host.getHost(),
baseURI = ShuffleUtils.constructBaseURIForShuffleHandler(host.getHost(),
host.getPort(), host.getPartitionId(), host.getPartitionCount(), applicationId, dagId, sslShuffle);
URL url = ShuffleUtils.constructInputURL(baseURI.toString(), attempts, httpConnectionParams.isKeepAlive());
httpConnection = ShuffleUtils.getHttpConnection(asyncHttp, url, httpConnectionParams,
Expand All @@ -364,13 +365,13 @@ boolean setupConnection(MapHost host, Collection<InputAttemptIdentifier> attempt
}
ioErrs.increment(1);
if (!connectSucceeded) {
LOG.warn(String.format("Failed to connect from %s to %s with %d inputs", localShuffleHost,
host, remaining.size()), ie);
LOG.warn("FETCH_FAILURE: Failed to connect from {} to {} with {} inputs, url: {}", localShuffleHost,
host, remaining.size(), baseURI, ie);
connectionErrs.increment(1);
} else {
LOG.warn(String.format(
"Failed to verify reply after connecting from %s to %s with %d inputs pending",
localShuffleHost, host, remaining.size()), ie);
LOG.warn(
"FETCH_FAILURE: Failed to verify reply after connecting from {} to {} with {} inputs pending, url: {}",
localShuffleHost, host, remaining.size(), baseURI, ie);
}

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

0 comments on commit cafa4b3

Please sign in to comment.