DESCRIPTION

JVMCBC-172: wait for actual last chunk of query response before reset

Motivation
----------
In the N1QL parser, we don't actually check if the chunk was the last
when transitioning to the DONE state. This leads to blocking when there
is still a little chunk with closing bracket(s) at the end.

Having the second of two requests blocking and seeing a "Starting
decoding of null" in the trace logs is symptomatic of this issue.

The parser should only be reset when in DONE state AND the chunk is the
actual last.

Modifications
-------------
Once the state has been transitioned to DONE, consider the sectionDone
only if this is the last chunk. Otherwise, continue to consume.

Fixed a DCP/feature-related test that wouldn't pass if query is enabled
via system property.

Result
------
No more blocking and "started decoding of null" in logs when attempting
two requests in a row, the parser correctly processes the small last
chunk.

Change-Id: I1c1e3aba5674f9ebf6950db54cf393eb8f47a12b
Reviewed-on: http://review.couchbase.org/48414
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2015-03-17 18:34:23.624000000

Change has been successfully cherry-picked as 84b557a0de4afe806754885a525558353d174f11

-------------------------------------
