hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohith (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-5542) Killing a job just as it finishes can generate an NPE in client
Date Fri, 17 Oct 2014 06:05:34 GMT

    [ https://issues.apache.org/jira/browse/MAPREDUCE-5542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14174755#comment-14174755

Rohith commented on MAPREDUCE-5542:

bq. Also the name doesn't seem to match how it's being used

bq. The logic in the new isJobFinished does not look correct. isJobFinished will always return
true as currently written
I think because of method name,it was being confused. But IIUC , It will return true if Job
is not in terminal states(KILLED/FAILED/SUCCEDED). Once Job reaches terminal states(killed/failed/succeded),
it return false.

bq. but we want to loop while the job is still active.
is below code OK?
  private boolean isJobInTerminalState(JobStatus status) {
    return status.getState() == JobStatus.State.KILLED
        || status.getState() == JobStatus.State.FAILED
        || status.getState() == JobStatus.State.SUCCEEDED;

public void killJob(JobID arg0) throws IOException, InterruptedException {
   while ((currentTimeMillis < timeKillIssued + 10000L)
          && (!isJobInTerminalState(status))) {
// inside while loop

if (status != null && !isJobInTerminalState(status)) {

> Killing a job just as it finishes can generate an NPE in client
> ---------------------------------------------------------------
>                 Key: MAPREDUCE-5542
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5542
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: client, mrv2
>    Affects Versions: 2.1.0-beta, 0.23.9
>            Reporter: Jason Lowe
>            Assignee: Rohith
>         Attachments: MAPREDUCE-5542.1.patch, MAPREDUCE-5542.2.patch, MAPREDUCE-5542.3.patch,
MAPREDUCE-5542.4.patch, MAPREDUCE-5542.5.patch
> If a client tries to kill a job just as the job is finishing then the client can crash
with an NPE.

This message was sent by Atlassian JIRA

View raw message