DESCRIPTION

JCBC-870: Fix double opening of AsyncBucket for each Bucket

Motivation:
-----------
During opening of a (sync) Bucket, two AsyncBucket would get opened:
the first one from the call to AsyncBucket.openBucket, and the second
one in the constructor of the CouchbaseBucket.
This is problematic since the closing of a bucket will mark only the
internal AsyncBucket as closed, not the one in the AsyncCluster's
cache, leading to bad internal state.

Modifications:
--------------
CouchbaseBucket now has a constructor that takes an AsyncBucket to reuse
instead of creating one from scratch. The old constructor is kept in
place as part of the public API but isn't used internally anymore.

Results:
--------
No double opening of AsyncBuckets, closing a Bucket will correctly mark
all corresponding AsyncBuckets as closed.

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


COMMENTS

author: Tate Garrett
date: 2015-11-02 17:35:53.444000000

Change has been successfully cherry-picked as 35cc801b1193d7640fdbd7c0c655ff5688f7bb50

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