[
https://issues.apache.org/jira/browse/TEZ-3696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15993729#comment-15993729
]
Eric Badger commented on TEZ-3696:
----------------------------------
Thanks for the response, [~bikassaha]!
bq. If the above is correct, then perhaps the issue would happen even without
speculation and on every attempt failure.
I don't believe it will happen for every attempt failure. It will only happen
for attempts that complete after the task has succeeded. If there's just a
single attempt failure then the task won't be completed and so it will call
{{sendDAGSchedulerFinishedEvent}}. It will only skip that code path if there
are multiple concurrent attempts for the same task. Otherwise the attempt will
either fail or succeed, call {{sendDAGSchedulerFinishedEvent}}, and then
succeed the task or schedule a new attempt.
bq. If this is correct, then perhaps the fix is only to send the completed
event all the time and not make any other changes in the dag scheduler itself.
If we did this, then every attempt would cause concurrency to decrement, not
just the running attempts. So if a task had 2 attempts (1 original, 1
speculative), and the speculative was pending, then once one of them succeeded
and sent the completed event, the other would be killed and also send a
completed event. Therefore we would decrement the running concurrency by 2 even
though only 1 task was running.
> Jobs can hang when both concurrency and speculation are enabled
> ---------------------------------------------------------------
>
> Key: TEZ-3696
> URL: https://issues.apache.org/jira/browse/TEZ-3696
> Project: Apache Tez
> Issue Type: Bug
> Reporter: Eric Badger
> Assignee: Eric Badger
> Attachments: TEZ-3696.001.patch, TEZ-3696.002.patch,
> TEZ-3696.003.patch
>
>
> We can reproduce the hung job by doing the following:
> 1. Run a sleep job with a concurrency of 1, speculation enabled, and 3 tasks
> {noformat}
> HADOOP_CLASSPATH="$TEZ_HOME/*:$TEZ_HOME/lib/*:$TEZ_CONF_DIR" yarn jar
> $TEZ_HOME/tez-tests-*.jar mrrsleep -Dtez.am.vertex.max-task-concurrency=1
> -Dtez.am.speculation.enabled=true -Dtez.task.timeout-ms=60000 -m 3 -mt 60000
> -ir 0 -irt 0 -r 0 -rt 0
> {noformat}
> 2. Let the 1st task run to completion and then stop the 2nd task so that a
> speculative attempt is scheduled. Once the speculative attempt is scheduled
> for the 2nd task, continue the original attempt and let it complete.
> {noformat}
> kill -STOP <pid>
> // wait a few seconds for a speculative attempt to kick off
> kill -CONT <pid>
> {noformat}
> 3. Kill the 3rd task, which will create a 2nd attempt
> {noformat}
> kill -9 <pid>
> {noformat}
> 4. The next thing to be drawn off of the queue will be the speculative
> attempt of the 2nd task. However, it is already completed, so it will just
> sit in the final state and the job will hang.
> Basically, for the failure to happen, the number of speculative tasks that
> are scheduled, but not yet ran has to be >= the concurrency of the job and
> there has to be at least 1 task failure.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)