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


COMMENTS

author: Natasha Sullivan
date: 2015-11-10 12:07:27.260000000

Uploaded patch set 3: Commit message was updated.

-------------------------------------
author: Gerrit Code Review
date: 2015-11-10 14:39:48.565000000

Change has been successfully cherry-picked as 54ae18bfb9be24ff0bdf638c0c78ebfbdb919567

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