Avoid a possible race condition.
Avoid a possible race condition.

The old code was relying on a DOWN message being sent before a call
to get the current ref counter. Its possible that the request was
sent before that happened causing an error.

The new code doesn't use messages from the child process and instead
uses a monitor to know when the process went down. Then it sends
up to 10,000 requests for the current count. Theoretically the only
way this will fail is if the DOWN message to the ref_counter is
delayed for an extremely long time or dropped entirely.



git-svn-id: c1f8a8ec0b3bb2e99ab3413722f81f687760e79c@925264 13f79535-47bb-0310-9956-ffa450edef68

Asquera/bigcouch,benoitc/bigcouch,linearregression/bigcouch,breezjw/bigcouch,davidcoallier/bigcouch,bittorrent/bigcouch,benoitc/bigcouch,Asquera/bigcouch,bittorrent/bigcouch,cloudant/bigcouch,benoitc/couchit_experiment,fkaempfer/couchdb,cloudant/bigcouch,KlausTrainer/bigcouch,kofron/bigcouch,fkaempfer/couchdb,Gussy/bigcouch,breezjw/bigcouch,davidcoallier/bigcouch,fkaempfer/couchdb,KlausTrainer/bigcouch,breezjw/bigcouch,georgemarshall/bigcouch,fkaempfer/couchdb,bittorrent/bigcouch,KlausTrainer/bigcouch,Gussy/bigcouch,Gussy/bigcouch,kofron/bigcouch,benoitc/bigcouch,andrejb/cloudant_bigcouch,davidcoallier/bigcouch,benoitc/bigcouch,georgemarshall/bigcouch,benoitc/bigcouch,PerilousApricot/bigcouch,georgemarshall/bigcouch,andrejb/cloudant_bigcouch,cloudant/bigcouch,fkaempfer/couchdb,bittorrent/bigcouch,georgemarshall/bigcouch,andrejb/cloudant_bigcouch,linearregression/bigcouch,kofron/bigcouch,fkaempfer/couchdb,PerilousApricot/bigcouch,bittorrent/bigcouch,KlausTrainer/bigcouch,linearregression/bigcouch,PerilousApricot/bigcouch,benoitc/couchit_experiment,benoitc/couchit_experiment,linearregression/bigcouch,georgemarshall/bigcouch,andrejb/cloudant_bigcouch,Gussy/bigcouch,kofron/bigcouch,linearregression/bigcouch,linearregression/bigcouch,davidcoallier/bigcouch,davidcoallier/bigcouch,cloudant/bigcouch,georgemarshall/bigcouch,benoitc/bigcouch,davidcoallier/bigcouch,andrejb/cloudant_bigcouch,andrejb/cloudant_bigcouch,Asquera/bigcouch,PerilousApricot/bigcouch,Asquera/bigcouch,Asquera/bigcouch,breezjw/bigcouch,cloudant/bigcouch,bittorrent/bigcouch,breezjw/bigcouch,Gussy/bigcouch,linearregression/bigcouch,KlausTrainer/bigcouch,Gussy/bigcouch,kofron/bigcouch,PerilousApricot/bigcouch,benoitc/couchit_experiment,cloudant/bigcouch,benoitc/couchit_experiment,kofron/bigcouch,Asquera/bigcouch,PerilousApricot/bigcouch,cloudant/bigcouch,KlausTrainer/bigcouch,breezjw/bigcouch,andrejb/cloudant_bigcouch