When a MR job like this:
- MR job with many map tasks, such as 10000 or more
- a few map output were lost or corrupted after map task complete successfully and before shuffle start
- mapreduce.task.timeout was set to 0 and mapreduce.task.progress-report.interval was not set
the shuffle of reduce task will get stuck in fetch failures loop for a long time, several or even dozens of hours.
It was caused by
MAPREDUCE-6740, it releate mapreduce.task.timeout with mapreduce.task.progress-report.interval by MRJobConfUtil.getTaskProgressReportInterval()
When mapreduce.task.timeout was set to 0 and mapreduce.task.progress-report.interval was not set, getTaskProgressReportInterval will retrun 0L.
In the class TaskReporter which is used to report task progress and status to AM, it set taskProgressInterval= MRJobConfUtil.getTaskProgressReportInterval(), and lock.wait(taskProgressInterval) before every progress report.
When mapreduce.task.timeout was set to 0, lock.wait(taskProgressInterval) will be lock.wait(0), and because there is no operation to notify it ,the reporter will wait all the time and don't report anything to AM.
So, when fetch failures happend in shuffle, TaskReporter will not report fetch failures to AM , although the log of reducer show message"Reporting fetch failure...", and the fetch failures loop will not stop util reduce task failed for exceeded MAX_FAILED_UNIQUE_FETCHES.
So, it's necessary to set a TASK_PROGRESS_REPORT_INTERVAL_MAX value (such as 30s) when the taskProgressInterval return by MRJobConfUtil.getTaskProgressReportInterval() equals 0 or beyond the max value, set the taskProgressInterval = TASK_PROGRESS_REPORT_INTERVAL_MAX.