> On Nov. 13, 2015, 6:57 a.m., Pranav Agarwal wrote:
> > lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java, 
> > line 1245
> > <https://reviews.apache.org/r/39911/diff/2/?file=1119315#file1119315line1245>
> >
> >     In my opinion we shouldn't change the default behavior of this API. 
> > Since the user asked to close the session this semantic implies that the 
> > underying queries should be killed.
> >     
> >     If we want to address the usecase of closing the session that are 
> > inactive and are not running any queries then driver should have an API to 
> > return the running queries for a session. And the caller should make a call 
> > whether they want to first check if there are any running queries in the 
> > driver before calling closeSession.
> 
> Puneet Gupta wrote:
>     I was wondering when user has issued an "asynchronous" query, why should 
> the user wait till the query finishes (sometimes more than a day). He can 
> close the cli/session and come back later and check the status or kill the 
> query or do other operations available via query handle. Keeping the session 
> open when a user doesn't intend to do any further oprations other than just 
> waiting for the async query result, can be wastage of resources for lens 
> server. When a sync query is issued, the behaviour can be different, if 
> really required.
> 
> Pranav Agarwal wrote:
>     In my opinion - If the queries are running, even after explictly closing 
> the session then it's counter intutive. Today the user know's if the session 
> is closed then all the queries fired from that session will be killed and 
> that makes good sense to me.
>     
>     I do understand the issue about async long running queries to continue 
> even after the session is closed. To handle that we can probably accept an 
> additonal parameter say "noHangUp" at the time of query submission and the 
> sessions running queries with noHangUp shouldn't be closed in Hive but can be 
> removed from LensServer. I would think only users querying via CLI will need 
> this option, as the session close for rest of the apps can be managed by the 
> client code.

>> In my opinion we shouldn't change the default behavior of this API. Since 
>> the user asked to close the session this semantic implies that the underying 
>> queries should be killed.

I would say this is not the default behavior, it right now fails only for few 
queries, which have pending tasks. 

I propose we should have the following behavior, if everyone agrees :
- All lens queries are async queries. Any query submitted through REST api is 
accessible in other sessions as well. so, session close here should not kill 
the query.
- CLI provides a way to submit sync queries, by waiting for completion of them 
on the same submission; such queries should be killed by cli on cli session 
close/control+c etc. Queries submitted through CLI through --async option 
should be accessible across sessions. With existing option of --async and sync 
way, i dont think we should add --noHandup as another option.


- Amareshwari


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39911/#review106370
-----------------------------------------------------------


On Nov. 8, 2015, 6:58 p.m., Deepak Barr wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39911/
> -----------------------------------------------------------
> 
> (Updated Nov. 8, 2015, 6:58 p.m.)
> 
> 
> Review request for lens.
> 
> 
> Repository: lens
> 
> 
> Description
> -------
> 
> OperationHandle-HiveSession mapping is maintained for all active operations. 
> Now, hive session will only be closed when there are no active operations 
> running on that session.
> 
> 
> Diffs
> -----
> 
>   lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java 
> c96ef20 
>   
> lens-server/src/test/java/org/apache/lens/server/query/TestQueryService.java 
> c37b0ed 
> 
> Diff: https://reviews.apache.org/r/39911/diff/
> 
> 
> Testing
> -------
> 
> Yes.
> 
> 1. Created session.
> 2. Fired a query.
> 3. Deleted the session before query finishes. 
> 4. Query keeps running and finishes eventually.
> 
> 
> Thanks,
> 
> Deepak Barr
> 
>

Reply via email to