DESCRIPTION

JVMCBC-355: Add identifier to UnicastAutoReleaseSubject

Motivation:
-----------
When an UnicastAutoReleaseSubject throws an error due to multiple
subscribers coming in or a single subscriber coming in after the
data has been auto-released, it is usually hard to know the exact
source of the error. In order to improve on that, each subject could
be assigned an id that would at least help tracing back to the code
and the type of data.

Modifications:
--------------
Added id field to the subject's State, which is used in the
exception message and can be set through a setter on the subject.

Made use of that feature in all points where an UnicastAutoRelease
is used: DCPConnection, ViewHandler and QueryHandler.
QueryHandler can even trace the requestID / clientContextID that
is triggering the issue.

Added unit tests that validates the exception message in failure
scenarios.

Results:
--------
Errors linked to UnicastAutoReleaseSubject can be better diagnosed.

Change-Id: Ifa54a86506fa72a1cebc288892278ef440911857


COMMENTS

author: Estrella Humphrey
date: 2016-08-03 12:21:06.875000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2016-08-03 12:21:32.162000000

Patch Set 1: Verified+1

-------------------------------------
author: Andreas Short
date: 2016-08-03 13:56:32.482000000

Patch Set 1: Code-Review+1

(1 comment)

I have a couple questions, though that's probably just for my understanding.  We'll talk shortly on this.

Line:90, src/main/java/com/couchbase/client/core/endpoint/dcp/DCPConnection.java -> There could be more than one of these, correct?  Do we need more trace identification information?

-------------------------------------
author: Andreas Short
date: 2016-08-03 14:21:08.108000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Cory Peck
date: 2016-08-03 16:21:49.157000000

Patch Set 1: Code-Review+1

(1 comment)

Line:90, src/main/java/com/couchbase/client/core/endpoint/dcp/DCPConnection.java -> For example:

  .withTraceIdentifier("DCPConnection." + env.dcpConnectionName())

-------------------------------------
author: Gerrit Code Review
date: 2016-08-03 16:37:08.935000000

Change has been successfully cherry-picked as 49c8c30e8cf63b7cc6e8d63517e935ee1dbd1d70 by Estrella Humphrey

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