Skip to content

MAPREDUCE-7026. Shuffle Fetcher does not log the actual error message thrown by ShuffleHandler #5150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import javax.net.ssl.HttpsURLConnection;

import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.Counters;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Reporter;
Expand Down Expand Up @@ -71,6 +72,7 @@ public class Fetcher<K, V> extends Thread {
private static final long FETCH_RETRY_DELAY_DEFAULT = 1000L;
static final int TOO_MANY_REQ_STATUS_CODE = 429;
private static final String FETCH_RETRY_AFTER_HEADER = "Retry-After";
private static final int MAX_ERROR_LENGTH = 10000;

protected final Reporter reporter;
@VisibleForTesting
Expand Down Expand Up @@ -508,6 +510,18 @@ private TaskAttemptID[] copyMapOutput(MapHost host,
decompressedLength = header.uncompressedLength;
forReduce = header.forReduce;
} catch (IllegalArgumentException e) {
byte[] bytes = new byte[MAX_ERROR_LENGTH];
int len = 0;
int c = input.read();
while (c != -1 || len < MAX_ERROR_LENGTH) {
bytes[len] = (byte) c;
len++;
c = input.read();
}
String errorMessage = Text.decode(bytes, 0, len);
if (errorMessage.length() > 0) {
LOG.warn("Error message from Shuffle Handler: " + errorMessage);
}
badIdErrs.increment(1);
LOG.warn("Invalid map id ", e);
//Don't know which one was bad, so consider all of them as bad
Expand Down