DESCRIPTION

JVMCBC-340: Fix KeepAlive not being sent anymore.

Motivation
----------
It was found that KeepAlives are not sent anymore after java-client
version 2.2.6 and later. Tracking this down, this is a regression
which has been introduced in the changeset for JVMCBC-300 which is an
optimization to send a void promise to save allocations.

As part of that change it was needed to change the netty idle state
handler from checking either read or write ("all") idle states to
only use "read" since write can't be used anymore on a void promise.

Modifications
-------------
The bug shows up because the code in the AbstractGenericHandler listens
for the "ALL_IDLE" token event, but netty is now emitting the "READ_IDLE"
event instead. The unit tests did not cover this since they also emit the
"ALL_IDLE" token to mirror the behavior of netty.

This changeset fixes the token to "READ_IDLE", adapts the unit tests and
adds an integration test to make sure the keepalives are really sent.

Result
------
The KeepAlives are now sent again.

Change-Id: I8d259fd2604f88f751bd38a449aca9acc776964e


COMMENTS

author: Natasha Sullivan
date: 2016-06-03 06:17:11.676000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2016-06-03 06:22:47.870000000

Patch Set 1: Verified+1

-------------------------------------
author: Estrella Humphrey
date: 2016-06-03 08:03:02.464000000

Patch Set 1:

(2 comments)

Line:65, src/integration/java/com/couchbase/client/core/util/ClusterDependentTest.java -> do you think there is a way of only setting it for the keepAlive integration test (so that keepAlive can be set way lower, but don't pollute other tests)?

Line:512, src/main/java/com/couchbase/client/core/endpoint/AbstractGenericHandler.java -> Maybe the if could be removed, would be future-proof against future changes in our Netty configuration (checking all IdleStateEvents)

-------------------------------------
author: Gerrit Code Review
date: 2016-06-03 08:22:01.472000000

Change has been successfully cherry-picked as 4c66d2e9d3ae058c5fbd920234a9165a506ffbe7 by Natasha Sullivan

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