DESCRIPTION

JVMCBC-274: Fix ExponentialDelay overflow

Motivation:
-----------
During computation, the bitwise operation causes the calculated delay
to circle back to its lower bound every 32 attempts.

Also, bitwise operation is invalid and not necessary on attempt 0.

Modifications:
--------------
Added protection for underflow/overflow errors so as to cap the stepping
to Long.MAX_VALUE (in turn it can be capped by the delay's upper bound).

Added a unit test to verify that the delay doesn't shrink back to lower
bound after more than 32 attempts.

Result:
-------
The delay will never shrink back to its lower bound but instead plateau
at its upper bound.

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


COMMENTS

author: Gerrit Code Review
date: 2015-12-28 15:50:48.582000000

Change has been successfully cherry-picked as f59be90ef16fba4b45b8949cac373a292250dccd

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