DESCRIPTION

JVMCBC-265: Services need to be cleaned up after failed bucket open attempt.

Motivation
----------
When a bucket open attempt fails for whatever reason, some resources like services
are currently not cleaned up properly. This is not an issue in the "fail startup
if bucket open doesn't work" approach, since most of the time the JVM exits.

In the edge case though where you want to fall back to another bucket or just
try to open one which does not exist and then keep going on, the core is
in an invalid state. Some of the services are DEGRADED, letting specific
ops not pass through as expected.

Modifications
-------------
The actual change is quite simple: if the config provider reports back to
the caller that the open bucket attempt was not successful, it now explicitly
closes the bucket.

This triggers a cleanup of services in the core layer as with a regular
bucket close process, allowing subsequent open bucket attempts to progress
as expected.

Result
------
Subsequent open bucket attempts after a failed one now have the chance
to succeed since the core now properly cleans up "stale" services and
resources.

Change-Id: I1e12fa233e543ab38e153586d11a2af83a15383e
Reviewed-on: http://review.couchbase.org/56859
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-on: http://review.couchbase.org/56863
Reviewed-by: Cory Peck xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2015-11-11 08:19:22.472000000

Change has been successfully cherry-picked as 1018b7446e979358ad3c50a0114015c99bf2e53a

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