hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Hsu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MAPREDUCE-5764) Potential NullPointerException in YARNRunner.killJob(JobID arg0)
Date Fri, 06 Mar 2015 04:42:38 GMT

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

Anthony Hsu updated MAPREDUCE-5764:
-----------------------------------
    Description: 
I found YARNRunner.killJob(JobID arg0) can throw NullPointerException if job status is null.

bq. clientCache.getClient(arg0).getJobStatus(arg0);  can be null.
This can happen when there is history write is failed because of hdfs errors or staging directory
is different from history server..
 
We need to have null check otherwise killJob() is prone to throw NPE which cause joblient
to exit.

{noformat}
@Override
  public void killJob(JobID arg0) throws IOException, InterruptedException {
    /* check if the status is not running, if not send kill to RM */
    JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
    if (status.getState() != JobStatus.State.RUNNING) {
      try {
        resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
      } catch (YarnException e) {
        throw new IOException(e);
      }
      return;
    }
.......
......
.......
  }
{noformat}

  was:
I found YARNRunner.killJob(JobID arg0) can throw NullPointerExpetion if job status is null.

bq. clientCache.getClient(arg0).getJobStatus(arg0);  can be null.
This can happen when there is history write is failed because of hdfs errors or staging directory
is different from history server..
 
We need to have null check otherwise killJob() is prone to throw NPE which cause joblient
to exit.

{noformat}
@Override
  public void killJob(JobID arg0) throws IOException, InterruptedException {
    /* check if the status is not running, if not send kill to RM */
    JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
    if (status.getState() != JobStatus.State.RUNNING) {
      try {
        resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
      } catch (YarnException e) {
        throw new IOException(e);
      }
      return;
    }
.......
......
.......
  }
{noformat}


> Potential NullPointerException in YARNRunner.killJob(JobID arg0)
> ----------------------------------------------------------------
>
>                 Key: MAPREDUCE-5764
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5764
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Rohith
>            Assignee: Rohith
>
> I found YARNRunner.killJob(JobID arg0) can throw NullPointerException if job status is
null. 
> bq. clientCache.getClient(arg0).getJobStatus(arg0);  can be null.
> This can happen when there is history write is failed because of hdfs errors or staging
directory is different from history server..
>  
> We need to have null check otherwise killJob() is prone to throw NPE which cause joblient
to exit.
> {noformat}
> @Override
>   public void killJob(JobID arg0) throws IOException, InterruptedException {
>     /* check if the status is not running, if not send kill to RM */
>     JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
>     if (status.getState() != JobStatus.State.RUNNING) {
>       try {
>         resMgrDelegate.killApplication(TypeConverter.toYarn(arg0).getAppId());
>       } catch (YarnException e) {
>         throw new IOException(e);
>       }
>       return;
>     }
> .......
> ......
> .......
>   }
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message