hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhihai xu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-16433) Not nullify variable "rj" to avoid NPE due to race condition in ExecDriver.
Date Thu, 13 Apr 2017 16:17:41 GMT

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

zhihai xu updated HIVE-16433:
-----------------------------
    Description: 
Not nullify variable {{rj}} to avoid NPE due to race condition in ExecDriver. currently  {{rj}}
is set to null in ExecDriver.shutdown which is called from other thread for query cancellation.
It can happen at any time. There is a potential race condition,  the rj is still accessed
after shutdown is called. For example: if the following code is executed right after ExecDriver.shutdown
is called.
{code}
      this.jobID = rj.getJobID();
      updateStatusInQueryDisplay();
      returnVal = jobExecHelper.progress(rj, jc, ctx);
{code}
Currently the purpose of nullifying  {{rj}} is mainly to make sure {{rj.killJob()}} is only
called once.
I will add a flag {{jobKilled}} to make sure {{rj.killJob()}} will be only called once.

  was:
Not nullify variable {{rj}} to avoid NPE due to race condition in ExecDriver. currently  {{rj}}
is set to null in ExecDriver.shutdown which is called from other thread for query cancellation.
It can happen at any time. There is a potential race condition,  the rj is still accessed
after shutdown is called. For example: if the following code is executed right after ExecDriver.shutdown
is called.
{code}
      this.jobID = rj.getJobID();
      updateStatusInQueryDisplay();
      returnVal = jobExecHelper.progress(rj, jc, ctx);
{code}
Currently the purpose of nullifying  {{rj}} is mainly to make sure {{rj.killJob()}} is only
called once.
I will add a flag jobKilled to make sure {{rj.killJob()}} will be only called once.


> Not nullify variable "rj" to avoid NPE due to race condition in ExecDriver.
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-16433
>                 URL: https://issues.apache.org/jira/browse/HIVE-16433
>             Project: Hive
>          Issue Type: Bug
>            Reporter: zhihai xu
>            Assignee: zhihai xu
>            Priority: Minor
>         Attachments: HIVE-16433.000.patch
>
>
> Not nullify variable {{rj}} to avoid NPE due to race condition in ExecDriver. currently
 {{rj}} is set to null in ExecDriver.shutdown which is called from other thread for query
cancellation. It can happen at any time. There is a potential race condition,  the rj is still
accessed after shutdown is called. For example: if the following code is executed right after
ExecDriver.shutdown is called.
> {code}
>       this.jobID = rj.getJobID();
>       updateStatusInQueryDisplay();
>       returnVal = jobExecHelper.progress(rj, jc, ctx);
> {code}
> Currently the purpose of nullifying  {{rj}} is mainly to make sure {{rj.killJob()}} is
only called once.
> I will add a flag {{jobKilled}} to make sure {{rj.killJob()}} will be only called once.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message