[ 
https://issues.apache.org/jira/browse/OOZIE-3715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenhaodan updated OOZIE-3715:
------------------------------
    Description: 
When I fork 2 transitions( A and B) to submit , when A fail , B still Running , 
because can't execute KillXCommand.
ActionXCommand execute failJob and add KillXCommand to commandQueue , but the 
commandQueue is the new Bean ActionXCommand not the SignalXCommand , so can't 
execute KillXCommand. The code is as follows :

 
{code:java}
new ActionStartXCommand(context.getAction().getId(), null).failJob(context)

public void failJob(ActionExecutor.Context context, WorkflowActionBean action) 
throws CommandException {
        WorkflowJobBean workflow = (WorkflowJobBean) context.getWorkflow();
        if (!handleUserRetry(context, action)) {
            incrActionErrorCounter(action.getType(), "failed", 1);
            LOG.warn("Failing Job due to failed action [{0}]", 
action.getName());
            try {
                workflow.getWorkflowInstance().fail(action.getName());
                WorkflowInstance wfInstance = workflow.getWorkflowInstance();
                ((LiteWorkflowInstance) 
wfInstance).setStatus(WorkflowInstance.Status.FAILED);
                workflow.setWorkflowInstance(wfInstance);
                workflow.setStatus(WorkflowJob.Status.FAILED);
                action.setStatus(WorkflowAction.Status.FAILED);
                action.resetPending();                queue(new 
WorkflowNotificationXCommand(workflow, action));
                queue(new KillXCommand(workflow.getId()));                
InstrumentUtils.incrJobCounter(INSTR_FAILED_JOBS_COUNTER_NAME, 1, 
getInstrumentation());
            }
            catch (WorkflowException ex) {
                throw new CommandException(ex);
            }
        }
    }{code}
 

 

  was:
When I fork 2 transitions( A and B) to submit , when A fail , B still Running , 
because can't execute KillXCommand.
ActionXCommand execute failJob and add KillXCommand to commandQueue , but the 
commandQueue is the new Bean ActionXCommand not the SignalXCommand , so can't 
execute KillXCommand. The code is as follows :

 
{code:java}
new ActionStartXCommand(context.getAction().getId(), 
null).failJob(context)public void failJob(ActionExecutor.Context context, 
WorkflowActionBean action) throws CommandException {
        WorkflowJobBean workflow = (WorkflowJobBean) context.getWorkflow();
        if (!handleUserRetry(context, action)) {
            incrActionErrorCounter(action.getType(), "failed", 1);
            LOG.warn("Failing Job due to failed action [{0}]", 
action.getName());
            try {
                workflow.getWorkflowInstance().fail(action.getName());
                WorkflowInstance wfInstance = workflow.getWorkflowInstance();
                ((LiteWorkflowInstance) 
wfInstance).setStatus(WorkflowInstance.Status.FAILED);
                workflow.setWorkflowInstance(wfInstance);
                workflow.setStatus(WorkflowJob.Status.FAILED);
                action.setStatus(WorkflowAction.Status.FAILED);
                action.resetPending();                queue(new 
WorkflowNotificationXCommand(workflow, action));
                queue(new KillXCommand(workflow.getId()));                
InstrumentUtils.incrJobCounter(INSTR_FAILED_JOBS_COUNTER_NAME, 1, 
getInstrumentation());
            }
            catch (WorkflowException ex) {
                throw new CommandException(ex);
            }
        }
    }{code}
 

 


> Fix fork out more than one transitions submit , one transition submit fail 
> can't execute KillXCommand
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OOZIE-3715
>                 URL: https://issues.apache.org/jira/browse/OOZIE-3715
>             Project: Oozie
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 5.2.1
>            Reporter: chenhaodan
>            Priority: Major
>             Fix For: 5.2.1
>
>         Attachments: OOZIE-3715.patch
>
>
> When I fork 2 transitions( A and B) to submit , when A fail , B still Running 
> , because can't execute KillXCommand.
> ActionXCommand execute failJob and add KillXCommand to commandQueue , but the 
> commandQueue is the new Bean ActionXCommand not the SignalXCommand , so can't 
> execute KillXCommand. The code is as follows :
>  
> {code:java}
> new ActionStartXCommand(context.getAction().getId(), null).failJob(context)
> public void failJob(ActionExecutor.Context context, WorkflowActionBean 
> action) throws CommandException {
>         WorkflowJobBean workflow = (WorkflowJobBean) context.getWorkflow();
>         if (!handleUserRetry(context, action)) {
>             incrActionErrorCounter(action.getType(), "failed", 1);
>             LOG.warn("Failing Job due to failed action [{0}]", 
> action.getName());
>             try {
>                 workflow.getWorkflowInstance().fail(action.getName());
>                 WorkflowInstance wfInstance = workflow.getWorkflowInstance();
>                 ((LiteWorkflowInstance) 
> wfInstance).setStatus(WorkflowInstance.Status.FAILED);
>                 workflow.setWorkflowInstance(wfInstance);
>                 workflow.setStatus(WorkflowJob.Status.FAILED);
>                 action.setStatus(WorkflowAction.Status.FAILED);
>                 action.resetPending();                queue(new 
> WorkflowNotificationXCommand(workflow, action));
>                 queue(new KillXCommand(workflow.getId()));                
> InstrumentUtils.incrJobCounter(INSTR_FAILED_JOBS_COUNTER_NAME, 1, 
> getInstrumentation());
>             }
>             catch (WorkflowException ex) {
>                 throw new CommandException(ex);
>             }
>         }
>     }{code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to