Zhihua Deng edited comment on HIVE-23727 at 7/1/20, 2:51 PM:

I'm wondering if we can improve the whole branch if (shouldRunAsync() && state 
!= OperationState.CANCELED && state != OperationState.TIMEDOUT)  here.  The 
codes here make some confusing to me, as state = OperationState.CLOSED will be 
the only case that the canceling background will take effect, in this case the 
operation may be finished, closed, failed, running(ctrl+c or session timeout) 
or pended. There is no need to cancel the finished, closed, failed operations, 
the running operations can be treated as the timeout operations, which are 
cleaned up by driver::close.

was (Author: dengzh):
I'm wondering if we can improve 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).

> 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: 50m
>  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

Reply via email to