hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From he...@apache.org
Subject svn commit: r1024358 - in /hadoop/zookeeper/trunk: CHANGES.txt src/contrib/zkpython/src/c/zookeeper.c src/contrib/zkpython/src/test/zktestbase.py
Date Tue, 19 Oct 2010 18:57:02 GMT
Author: henry
Date: Tue Oct 19 18:57:02 2010
New Revision: 1024358

URL: http://svn.apache.org/viewvc?rev=1024358&view=rev
Log:
ZOOKEEPER-888: c-client / zkpython: Double free corruption on node
watcher (Austin Shoemaker via henryr)

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c
    hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/zktestbase.py

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=1024358&r1=1024357&r2=1024358&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Tue Oct 19 18:57:02 2010
@@ -117,6 +117,8 @@ BUGFIXES: 
   ZOOKEEPER-855. clientPortBindAddress should be clientPortAddress
   (Jared Cantwell via fpj)
 
+  ZOOKEEPER-888. c-client / zkpython: Double free corruption on node watcher (Austin Shoemaker
via henryr)
+
 IMPROVEMENTS:
   ZOOKEEPER-724. Improve junit test integration - log harness information 
   (phunt via mahadev)

Modified: hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c?rev=1024358&r1=1024357&r2=1024358&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c Tue Oct 19 18:57:02 2010
@@ -436,7 +436,7 @@ void watcher_dispatch(zhandle_t *zzh, in
   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL) {
     PyErr_Print();
   }
-  if (pyw->permanent == 0) {
+  if (pyw->permanent == 0 && (type != ZOO_SESSION_EVENT || is_unrecoverable(zzh)))
{
     free_pywatcher(pyw);
   }
   PyGILState_Release(gstate);
@@ -1395,7 +1395,7 @@ PyObject *pyis_unrecoverable(PyObject *s
     return NULL;
   CHECK_ZHANDLE(zkhid);
   int ret = is_unrecoverable(zhandles[zkhid]);
-  if (ret > 0)
+  if (ret == ZINVALIDSTATE)
     Py_RETURN_TRUE;
   Py_RETURN_FALSE;
 }

Modified: hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/zktestbase.py
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/zktestbase.py?rev=1024358&r1=1024357&r2=1024358&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/zktestbase.py (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/test/zktestbase.py Tue Oct 19 18:57:02
2010
@@ -21,9 +21,11 @@ import unittest, threading, zookeeper
 ZOO_OPEN_ACL_UNSAFE = {"perms":0x1f, "scheme":"world", "id" :"anyone"}
 
 class TestBase(unittest.TestCase):
+    SERVER_PORT = 22182
+    
     def __init__(self,methodName='runTest'):
         unittest.TestCase.__init__(self,methodName)
-        self.host = "localhost:22182"
+        self.host = "localhost:%d" % self.SERVER_PORT
         self.connected = False
         self.handle = -1
         logdir = os.environ.get("ZKPY_LOG_DIR")



Mime
View raw message