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

Peter Bacsko commented on OOZIE-2911:
-------------------------------------

Comments:

1) What does this code do? What does externalChildIDs contain that require this 
sort of splitting?

{code}
       JobClient jobClient = 
Services.get().get(HadoopAccessorService.class).createJobClient(user, conf);
       String[] idParts = externalChildIDs.split("_");
       JobID jobID = new JobID(idParts[1], Integer.parseInt(idParts[2]));
       final RunningJob mrJob = jobClient.getJob(jobID);
{code}

2) Wouldn't it be good to log the external IDs that we're about to kill?

{code}
            String externalChildIDs = action.getExternalChildIDs();
            // LOG application IDs here?      <-------- ??
            if(externalChildIDs != null) {
               for(String childId : externalChildIDs.split(",")) {
                    try {
                        
yarnClient.killApplication(ConverterUtils.toApplicationId(childId.trim()));
                    } catch (Exception e) {
                        LOG.warn("Could not kill external child of {0}, {1}", 
action.getExternalId(),
                                childId);
                   }
                }
{code}




> Re-add test testWfActionKillChildJob and adapt it to OYA
> --------------------------------------------------------
>
>                 Key: OOZIE-2911
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2911
>             Project: Oozie
>          Issue Type: Sub-task
>            Reporter: Peter Bacsko
>            Assignee: Peter Cseh
>         Attachments: OOZIE-2911-001.patch, OOZIE-2911-002.patch, 
> OOZIE-2911-003.patch, OOZIE-2911-004.patch
>
>
> Original test case was:
> {code}
>  public void testWfActionKillChildJob() throws Exception {
>         String externalJobID = launchSleepJob(1000);
>         String childId = launchSleepJob(1000000);
>         WorkflowJobBean job = 
> this.addRecordToWfJobTable(WorkflowJob.Status.KILLED, 
> WorkflowInstance.Status.KILLED);
>         WorkflowActionBean action = 
> this.addRecordToWfActionTable(job.getId(), externalJobID, "1",
>                 WorkflowAction.Status.KILLED, childId);
>         new ActionKillXCommand(action.getId()).call();
>         JobClient jobClient = createJobClient();
>         final RunningJob mrJob = jobClient.getJob(JobID.forName(childId));
>         waitFor(60 * 1000, new Predicate() {
>             public boolean evaluate() throws Exception {
>                 return mrJob.isComplete();
>             }
>         });
>         assertEquals(mrJob.getJobState(), JobStatus.KILLED);
>     }
> {code}
> It was removed by OOZIE-1770's 
> [commit|https://github.com/apache/oozie/commit/21761f5b5b2b4457302aef780239610d076047e5#diff-aebe75e7912a7ba12c52f4ea356b61feL120]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to