DESCRIPTION

JVMCBC-372: Add an upper bound to the sentRequestQueue.

Motivation
----------
Currently when a socket is alive but never responding to requests
we write and write into it but responses never arrive. This makes
the sentRequestQueue pile up requests and this queue is not bounded.

Modifications
-------------
The code now, before encoding it down the pipeline, checks if an
upper limit is reached (which defaults to 1024 and can be configured
via the com.couchbase.sentRequestQueueLimit system property) and if
so sends it into the usual reschedule path, giving it a chance to
be cancelled if it circles around for too long and definitely not
getting stuck in there forever.

Result
------
As a result, a maximum of 1024 requests by default can be stuck on
a non-responding socket, preventing filling up the heap and leaking
requests that will never be finished. Note that this is not addressing
a potential root cause of a non-responding socket but rather making
sure that the effects when it happens are minimized to the overall
JVM and giving the upper layers a chance to react accordingly.

Change-Id: Icaa5ab16d012d276891ec9ff8073d7a9e7e3804f


COMMENTS

author: Natasha Sullivan
date: 2016-10-26 18:58:18.451000000

Uploaded patch set 5.

-------------------------------------
author: Natasha Sullivan
date: 2016-10-26 19:00:55.771000000

Patch Set 5: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2016-10-26 19:01:32.100000000

Patch Set 5:

increased the batch size to account better for larger batches, while still not allowing it to grow "unbounded" - for now people can set it to smaller values with the sys property if they want to.

-------------------------------------
author: Gerrit Code Review
date: 2016-10-27 05:07:52.699000000

Change has been successfully cherry-picked as e0f01b8e90ecd4417f25e5ef250dc9b0a3ff09a7 by Natasha Sullivan

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