[ 
https://issues.apache.org/jira/browse/HIVE-2017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145497#comment-13145497
 ] 

Chinna Rao Lalam commented on HIVE-2017:
----------------------------------------

Hi Namit,


Here need to cleanup 2 kinds of tasks one is non-mr tasks and mr tasks. For 
stopping non-mr tasks used the thread.interrupt() because every non-mr task 
will be executed as a thread and for mr tasks maintained a variable called 
jobKillUri's this variable will track the spawned job kill uri, in 
taskCleanup() if it is a mr task using this variable kill the job.

Here for the non-mr tasks thread.interrupt() may not help completely because 
they can catch InterruptedException and continue  and in some scenarios nothing 
it will do (As per API documentation)  other than just setting interrupt status 
to true for the thread these cases it will not stop the thread.

So we can add one variable like "isInterrupted" in Task.java and set it to true 
when we want to stop this (Ex in taskCleanup()) while execution of task before 
doing any major operation check this variable isInterrupted and if it is true 
return immediately  but with this approach we need add more checks for 
isInterrupted statements in all tasks.

So we need to add statements for checking  isInterrupted is set or not  in all 
the tasks before doing any operation it will take some good amount of time(Ex 
in ExecDriver before submitting the job) pls give u r inputs on this..

                
> Driver.execute() should maintaining SessionState in case of runtime errors
> --------------------------------------------------------------------------
>
>                 Key: HIVE-2017
>                 URL: https://issues.apache.org/jira/browse/HIVE-2017
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ning Zhang
>            Assignee: Chinna Rao Lalam
>         Attachments: HIVE-2017.1.patch, HIVE-2017.2.patch, HIVE-2017.3.patch, 
> HIVE-2017.4.patch
>
>
> Here's a snippet from Driver.execute():
> {code}
>             // TODO: This error messaging is not very informative. Fix that.
>             errorMessage = "FAILED: Execution Error, return code " + exitVal 
> + " from "
>                 + tsk.getClass().getName();
>             SQLState = "08S01";
>             console.printError(errorMessage);
>             if (running.size() != 0) {
>               taskCleanup();
>             }
>             return 9;
> {code}
> I simply returned in case of runtime errors without maintaining SessionState. 
> It could cause resource leak mentioned in HIVE-1959. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to