DESCRIPTION

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

Motivation
----------
Currently when a socket is alive but never responding to requests
we write into it as 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 5120 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 5120 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
Reviewed-on: http://review.couchbase.org/68572
Reviewed-by: Marques Ellis xxx@xxx.xxx
Tested-by: Marques Ellis xxx@xxx.xxx


COMMENTS

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

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

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