[ 
https://issues.apache.org/jira/browse/TEZ-2996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15055380#comment-15055380
 ] 

Jeff Zhang commented on TEZ-2996:
---------------------------------

It would be better to put these outside of the if block (before the if block) 
so that it can cover both recovery and non-recovery case. 
{code}
       if (ta.recoveryData == null ||
           ta.recoveryData.getTaskAttemptFinishedEvent() == null) {
+        if (event instanceof DiagnosableEvent) {
+          ta.addDiagnosticInfo(((DiagnosableEvent) event).getDiagnosticInfo());
+        }
+        if (event instanceof TaskAttemptEventTerminationCauseEvent) {
+          ta.trySetTerminationCause(((TaskAttemptEventTerminationCauseEvent) 
event).getTerminationCause());
+        } else {
+          throw new TezUncheckedException("Invalid event received in 
TerminateTransition"
+                  + ", requiredClass=TaskAttemptEventTerminationCauseEvent"
+                  + ", eventClass=" + event.getClass().getName());
+        }
         ta.se
{code}

bq. Separate question - upon recovery - will members like 
diagnostics/termination cause be refreshed from recovered state or not?
Yes, diagnostics/terminationcause will be reset to the original value. But it 
is not set directly, it is propagated through events.
{code}
switch (taFinishedEvent.getState()) {
          case FAILED:
            if (LOG.isDebugEnabled()) {
              LOG.debug("TaskAttemptFinishedEvent is seen with state of FAILED"
                  + ", send TA_FAILED to itself"
                  + ", attemptId=" + ta.attemptId);
            }
            ta.sendEvent(new TaskAttemptEventAttemptFailed(ta.getID(), 
TaskAttemptEventType.TA_FAILED,
                taFinishedEvent.getDiagnostics(), 
taFinishedEvent.getTaskAttemptError(), true));
            break;
{code}

It is not valid now. We can remove it.

{code}
// TODO Creating the remote task here may not be required in case of
      // recovery.
{code}

> TestAnalyzer fails in trunk
> ---------------------------
>
>                 Key: TEZ-2996
>                 URL: https://issues.apache.org/jira/browse/TEZ-2996
>             Project: Apache Tez
>          Issue Type: Sub-task
>            Reporter: Bikas Saha
>            Assignee: Bikas Saha
>         Attachments: TEZ-2996.1.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to