asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann" <ti...@apache.org>
Subject Re: Async query waits for job completion
Date Wed, 30 Dec 2015 08:11:35 GMT
Hi Wail,

On 30 Dec 2015, at 7:07, Wail Alkowaileet wrote:

> Dears,
>
> First, sorry for the many emails ...
>
> I have a question about the RESTAPI. I see that Async query get 
> blocked
> until the job is completed ... is that intentional ?
>
> if so ... this can fail a job if it takes too long (> HTTP timeout).
>
> in QueryTranslator:
> switch (resultDelivery) {
>                   case ASYNC:
>                       JSONArray handle = new JSONArray();
>                       handle.put(jobId.getId());
>
> handle.put(metadataProvider.getResultSetId().getId());
>                       response.put("handle", handle);
>                       sessionConfig.out().print(response);
>                       sessionConfig.out().flush();
>                       hcc.waitForCompletion(jobId); *<-- should we 
> remove
> this one ?*
>                       break;
>
> As a result, I've never seen the status as RUNNING. it's always 
> SUCCESS or
> some sort of runtime exception payload. Even for query takes multiple
> seconds.

Reading the code I was assuming that the flushing of the output stream 
would return the result to the client. But if you don’t see control 
begin returned to the client, then that’s probably not the case :)

> Removing waitForCompletion will need some modifications on the Result
> framework interfaces to report the exceptions when query status = 
> FAILURE
> instead of throwing it to a finished HTTP session.
>
> Before reporting a JIRA issue, is there any "internal consequences" if 
> the
> client didn't wait? I didn't see any issue from my brief testings ...

I’m not sure I understand the suggested changes to the result 
framework sufficiently.
But I do think that we need to maintain control of the lifecycle of the 
Hyracks job and so just removing the waiting doesn’t sound right to 
me.
I think that it’d be good to file an issue stating the problem clearly 
and to potentially add a solution proposal as a first comment.

Cheers,
Till

Mime
View raw message