[ https://issues.apache.org/jira/browse/HADOOP-4236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639699#action_12639699 ]
Sameer Paranjpye commented on HADOOP-4236: ------------------------------------------ When is a JobInProgress created, as soon as a job is submitted or when it is considered for running?? If the former then having a 'initStarted' flag would make sense. Because {{if (!initStarted)}} then it could be a long time before a job is considered for running and it'll hang around in the queue, killed but not purged. If so, I think this patch does the right thing. Regardless of whether or not we need an {{initStarted}} flag, I think it's cleaner to create a {{JobInitKillStatus}} class with the flags as members and synchronizie around an instance of this class. As far as this patch goes, I think {code} synchronized(tasksInited){ if(jobKilled) { terminateJob(JobStatus.KILLED); return; } initStarted = true; } {code} should just be {code} synchronized(tasksInited){ if(jobKilled) { return; } initStarted = true; } {code} > JobTracker.killJob() fails to kill a job if the job is not yet initialized > -------------------------------------------------------------------------- > > Key: HADOOP-4236 > URL: https://issues.apache.org/jira/browse/HADOOP-4236 > Project: Hadoop Core > Issue Type: Bug > Components: mapred > Affects Versions: 0.19.0 > Reporter: Amar Kamat > Assignee: Sharad Agarwal > Priority: Blocker > Fix For: 0.19.0 > > Attachments: 4236_v1.patch, 4236_v2.patch, 4236_v3.patch > > > HADOOP-3864 made the following changes to {{JobTracker.killJob()}} > {code} > public synchronized void killJob(JobID jobid) { > JobInProgress job = jobs.get(jobid); > - job.kill(); > + if (job.inited()) { > + job.kill(); > + } > } > {code} > This is a bug as a job will not get killed if its not yet initialized. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.