DESCRIPTION

JCBC-475: Harden configuration provider on shutdown and restarting of nodes.

Motivation
----------
The current configuration provider runs into issues when nodes are restarted in
several edge cases. Also, shutdown handling was subject to race conditions, leaving
threads behind and as a result kept JVMs running.

Modifications
-------------
This changeset makes several modifications to the provider:
	- A shutdown variable is introduced and crucial parts of the code are made
	  aware of it, stopping their work if shutdown is true.
	- If a new carrier provider is set, the code now checks if there was an old
	  one in place, shutting it down. This makes sure that no threads are left
	  behind.
	- Only monitor the bucket in http bootstrap, avoiding weird stack overflows
	  if monitoring and bootstrapping does not succeed (if only one node is used
	  and it is restarted).

In addition the used CouchbaseConfigConnection has been clarified a bit so that
from a thread dump it is now visible if a data IO thread is meant or the config
thread for carrier configs.

Result
------
In general, the resulting provider should be more resilient to failure and should not
leave threads behind on shutdown.

Change-Id: Ic3c4026494c858e03d63767dd953675104687e0b


COMMENTS

author: Natasha Sullivan
date: 2014-06-25 05:35:18.870000000

Uploaded patch set 2.

-------------------------------------
author: Andreas Short
date: 2014-06-25 05:48:42.501000000

Patch Set 2: Code-Review+2

(1 comment)

Line:128, src/main/java/com/couchbase/client/vbucket/provider/BucketConfigurationProvider.java -> Oh, I was okay with this going to debug, but I'm also okay with it at info.  Up to you.

-------------------------------------
author: Natasha Sullivan
date: 2014-06-25 06:04:07.150000000

Patch Set 2: Verified+1

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