DESCRIPTION

JCBC-895: Prevent overflow on MAX_VALUE retry

Motivation:
-----------
Retry attempt being set to Integer.MAX_VALUE actually causes an
overflow because the internal retry mechanism adds 1 to the given
attempt limit.

Modifications:
--------------
RetryBuilder and RetryWithDelayHandler both cap the maxAttempt parameter
to Integer.MAX_VALUE - 1 and document this limitation of their input.

DefaultAsyncBucketMananger was setting such a maxAttempt so it has been
modified as well to directly provide a correct value.

Unit tests added to check that the input value of maxAttempts is
decremented by one if it is MAX_VALUE.

Result:
-------
No more "java.lang.IllegalArgumentException: Count can not be negative"
error when the maxAttempts is set to MAX_VALUE.

Change-Id: Ib4cf179fa2b34aa19947ce76e9c85121c669c84a


COMMENTS

author: Estrella Humphrey
date: 2015-12-24 10:04:43.444000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2015-12-24 10:25:18.807000000

Patch Set 1: Verified+1

-------------------------------------
author: Cory Peck
date: 2015-12-24 10:34:18.029000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Tate Garrett
date: 2015-12-24 10:38:27.179000000

Change has been successfully cherry-picked as bda4e042d01c83075986a0842c03a7525e2f607c

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