DESCRIPTION

JVMCBC-412 Fix extras leak on IllegalReferenceCountException

Motivation
----------
If there was an error encoding the request, the extras bytebuf allocated
will leak.

Changes
-------
On exception trying to retain content, release extras allocated for the
request and rethrow the exception.

Results
-------
There is no leak now while running leak detector on the encode failure
feature test.

Change-Id: Id3383a58aab9fe07448b9c22eb1beb3d70e2767d


COMMENTS

author: Marques Ellis
date: 2017-03-31 00:46:57.433000000

Uploaded patch set 1.

-------------------------------------
author: Marques Ellis
date: 2017-03-31 05:12:32.378000000

Patch Set 1: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2017-03-31 07:12:33.674000000

Patch Set 1:

(1 comment)

Line:218, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> great catch, but can you add a check "if extras != null?" and also then a nested try/catch since this in theory could also raise an exception?

I know its a bit involved but probably worth it

-------------------------------------
author: Cory Peck
date: 2017-03-31 07:45:39.213000000

Patch Set 1:

(1 comment)

Line:216, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> Could you also reformat this code block to have space after "catch"?

-------------------------------------
author: Marques Ellis
date: 2017-03-31 14:36:52.820000000

Patch Set 1:

(2 comments)

Line:216, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> yes

Line:218, src/main/java/com/couchbase/client/core/endpoint/kv/KeyValueHandler.java -> sure I'll add it

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