hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhiyuan Yang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-17641) Visibility issue of Task.done cause Driver skip stages in parallel execution
Date Thu, 28 Sep 2017 22:13:00 GMT

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

Zhiyuan Yang updated HIVE-17641:
--------------------------------
    Status: Patch Available  (was: In Progress)

> Visibility issue of Task.done cause Driver skip stages in parallel execution
> ----------------------------------------------------------------------------
>
>                 Key: HIVE-17641
>                 URL: https://issues.apache.org/jira/browse/HIVE-17641
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.14.1
>            Reporter: Zhiyuan Yang
>            Assignee: Zhiyuan Yang
>         Attachments: HIVE-17641.1-branch-0.14.patch
>
>
> Task.done is not volatile. In case of parallel execution, TaskRunner thread set this
value, and Driver thread read this value when it determines whether a child task is runnable
> DriverContext.java
> {code}
> public static boolean isLaunchable(Task<? extends Serializable> tsk) {
>     return !tsk.getQueued() && !tsk.getInitialized() && tsk.isRunnable();
> {code}
> Task.java
> {code}
> public boolean isRunnable() {
>     boolean isrunnable = true;
>     if (parentTasks != null) {
>       for (Task<? extends Serializable> parent : parentTasks) {
>         if (!parent.done()) {
> {code}
> This happens without any synchronization, so a child can be not runnable even all parents
finish.
> To make it worse, Driver think query is successful when there is no running task or runnable
task, so query may finish without executing some stages.
> Driver.java
> {code}
> while (!destroyed && driverCxt.isRunning()) {
> {code}
> DriverContext.java
> {code}
> public synchronized boolean isRunning() {
>     return !shutdown && (!running.isEmpty() || !runnable.isEmpty());
> {code}



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

Mime
View raw message