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

Zhihua Deng edited comment on HIVE-23727 at 6/22/20, 3:00 AM:
--------------------------------------------------------------

I'm wondering if we can remove the whole branch ```_if (shouldRunAsync() && 
state != OperationState.CANCELED && state != OperationState.TIMEDOUT)_ ``` 
here.  The codes make some confusing to me, as if the driver::close has done 
the case when the operation being canceled or timeout and there is no need to 
cancel the backgound of the operation being closed, finished or failed(error). 
The cases that the canceling background will take effect are operations being 
RUNNING and PENDING(_state=__OperationState._CLOSED is passed to _cleanup, ctrl 
+ c)_ but canceling the background of a running operation can be treated as the 
timeout operation(cause they are running operation before timeout).


was (Author: dengzh):
I'm wondering if we can remove the whole branch ```_if (shouldRunAsync() && 
state != OperationState.CANCELED && state != OperationState.TIMEDOUT)_ ``` 
here.  The codes make some confusing to me, The driver::close has done the case 
when the operation being canceled or timeout,  and there is no need to close 
the operation being closed, finished or failed(error). The operation being 
running is the only case the canceling background will take effect, but the 
operation can be treated as the timeout operation(cause they are running 
operation before timeout), which would finally cleanup by calling driver::close.

> Improve SQLOperation log handling when cleanup
> ----------------------------------------------
>
>                 Key: HIVE-23727
>                 URL: https://issues.apache.org/jira/browse/HIVE-23727
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Zhihua Deng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The SQLOperation checks _if (shouldRunAsync() && state != 
> OperationState.CANCELED && state != OperationState.TIMEDOUT)_ to cancel the 
> background task. If true, the state should not be OperationState.CANCELED, so 
> logging under the state == OperationState.CANCELED should never happen.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to