Browse Source

ZOOKEEPER-897. C Client seg faults during close (jared cantwell via mahadev)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@1028373 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 14 years ago
parent
commit
fc0f266c93
2 changed files with 7 additions and 1 deletions
  1. 2 0
      CHANGES.txt
  2. 5 1
      src/c/src/zookeeper.c

+ 2 - 0
CHANGES.txt

@@ -140,6 +140,8 @@ BUGFIXES:
   ZOOKEEPER-904. super digest is not actually acting as a full superuser
   (Camille Fournier via mahadev)
 
+  ZOOKEEPER-897. C Client seg faults during close (jared cantwell via mahadev)
+
 IMPROVEMENTS:
   ZOOKEEPER-724. Improve junit test integration - log harness information 
   (phunt via mahadev)

+ 5 - 1
src/c/src/zookeeper.c

@@ -2290,7 +2290,11 @@ int zookeeper_close(zhandle_t *zh)
 
     zh->close_requested=1;
     if (inc_ref_counter(zh,0)!=0) {
-        cleanup_bufs(zh, 1, ZCLOSING);
+	/* Signal any syncronous completions before joining the threads */
+        enter_critical(zh);
+        free_completions(zh,1,ZCLOSING);
+        leave_critical(zh);
+
         adaptor_finish(zh);
         return ZOK;
     }