|
@@ -1365,30 +1365,39 @@ public class TaskTracker
|
|
Path filename = conf.getLocalPath(mapId+"/part-"+reduce+".out");
|
|
Path filename = conf.getLocalPath(mapId+"/part-"+reduce+".out");
|
|
response.setContentLength((int) fileSys.getLength(filename));
|
|
response.setContentLength((int) fileSys.getLength(filename));
|
|
InputStream inStream = null;
|
|
InputStream inStream = null;
|
|
|
|
+ // true iff IOException was caused by attempt to access input
|
|
|
|
+ boolean isInputException = true;
|
|
try {
|
|
try {
|
|
inStream = fileSys.open(filename);
|
|
inStream = fileSys.open(filename);
|
|
try {
|
|
try {
|
|
int len = inStream.read(buffer);
|
|
int len = inStream.read(buffer);
|
|
while (len > 0) {
|
|
while (len > 0) {
|
|
- outStream.write(buffer, 0, len);
|
|
|
|
|
|
+ try {
|
|
|
|
+ outStream.write(buffer, 0, len);
|
|
|
|
+ } catch (IOException ie) {
|
|
|
|
+ isInputException = false;
|
|
|
|
+ throw ie;
|
|
|
|
+ }
|
|
len = inStream.read(buffer);
|
|
len = inStream.read(buffer);
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
inStream.close();
|
|
inStream.close();
|
|
- outStream.close();
|
|
|
|
}
|
|
}
|
|
} catch (IOException ie) {
|
|
} catch (IOException ie) {
|
|
TaskTracker tracker =
|
|
TaskTracker tracker =
|
|
(TaskTracker) context.getAttribute("task.tracker");
|
|
(TaskTracker) context.getAttribute("task.tracker");
|
|
Log log = (Log) context.getAttribute("log");
|
|
Log log = (Log) context.getAttribute("log");
|
|
- String errorMsg = "getMapOutput(" + mapId + "," + reduceId +
|
|
|
|
- ") failed :\n"+
|
|
|
|
- StringUtils.stringifyException(ie);
|
|
|
|
|
|
+ String errorMsg = ("getMapOutput(" + mapId + "," + reduceId +
|
|
|
|
+ ") failed :\n"+
|
|
|
|
+ StringUtils.stringifyException(ie));
|
|
log.warn(errorMsg);
|
|
log.warn(errorMsg);
|
|
- tracker.mapOutputLost(mapId, errorMsg);
|
|
|
|
|
|
+ if (isInputException) {
|
|
|
|
+ tracker.mapOutputLost(mapId, errorMsg);
|
|
|
|
+ }
|
|
response.sendError(HttpServletResponse.SC_GONE, errorMsg);
|
|
response.sendError(HttpServletResponse.SC_GONE, errorMsg);
|
|
throw ie;
|
|
throw ie;
|
|
}
|
|
}
|
|
|
|
+ outStream.close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|