FIX: clear azk_count during zookeeper rejoin process
@@ -340,6 +340,13 @@ static void inc_count(int delta)
pthread_mutex_unlock(&azk_mtx);
}
+static void clear_count(void)
+{
+ pthread_mutex_lock(&azk_mtx);
+ azk_count = 0;
+ pthread_mutex_unlock(&azk_mtx);
+}
+
static int wait_count(int timeout)
{
struct timeval tv;
@@ -1674,6 +1681,8 @@ int arcus_zk_rejoin_ensemble()
{
int ret = 0;
+ clear_count();
+
pthread_mutex_lock(&zk_lock);
if (main_zk->zh != NULL) {
