Can you debug why the diagnostics from the reportedStatus is empty? We need to make sure the remote-diagnostics are not getting lost. Otherwise, we will only see the diagnostics produce inside the AM.
I debugged the code, reportedStatus is getting updated from the task status with statusUpdate API from the TaskUmbilicalProtocol. This task status is getting creating with empty diagnostic info(code mentioned below) and no where else it is getting updated after that.
this.taskStatus = TaskStatus.createTaskStatus(isMapTask(), this.taskId,
"", "", "",
When the task fails, task is reporting using reportDiagnosticInfo from the TaskUmbilicalProtocol and same is available in the taskAttempt.
Also, what is the test that you used and what is the error message that you saw?
As you have mentioned in the previous comment, deleting input file after the job starts and simulated the same. I have attached history UI screen shot for failed task after the changes.
In any case, there is one more occurrence of usage of the diagnostics-info from the 'reportedStatus' in TaskAttemptImpl.getReport(), we should fix that.
I missed it. I will look into this.
Adding a test will greatly help this. You can look at TestMRApp|TestFail|TestKill for inspiration.
I am very much interested to add new testcases. In this case, changes are in private method, the method present in private class and also changes are very minimal. Thanks for the information. I will add new test cases.