[SCM] Apache ZooKeeper branch, master, updated. debian/3.3.5+dfsg1-1-1-gddc71b5

James Page james.page at ubuntu.com
Tue Mar 27 11:43:36 UTC 2012


The following commit has been merged in the master branch:
commit ddc71b5c061e59844939acf954c581b298a08f0f
Author: James Page <james.page at ubuntu.com>
Date:   Tue Mar 27 12:43:13 2012 +0100

    d/patches/fixes/ZOOKEEPER-1431: Fix up memory leak in zookeeper python binding which results in significant memory growth for large result sets (Closes: #). Thanks to Johan Rydberg for identifying  this bug and Kapil Thangavelu for the patch.

diff --git a/debian/changelog b/debian/changelog
index 4346e20..811bbbb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+zookeeper (3.3.5+dfsg1-2) UNRELEASED; urgency=low
+
+  * d/patches/fixes/ZOOKEEPER-1431: Fix up memory leak in zookeeper
+    python binding which results in significant memory growth for large
+    result sets (Closes: #). Thanks to Johan Rydberg for identifying 
+    this bug and Kapil Thangavelu for the patch.
+
+ -- James Page <james.page at ubuntu.com>  Tue, 27 Mar 2012 12:40:37 +0100
+
 zookeeper (3.3.5+dfsg1-1) unstable; urgency=low
 
   * New upstream bugfix release.
diff --git a/debian/patches/fixes/ZOOKEEPER-1431 b/debian/patches/fixes/ZOOKEEPER-1431
new file mode 100644
index 0000000..aaf4f90
--- /dev/null
+++ b/debian/patches/fixes/ZOOKEEPER-1431
@@ -0,0 +1,71 @@
+Description: Fix up memory leak for large results set in zk
+ python bindings.
+Author: Kapil Thangavelu <kapil.thangavelu at canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/zookeeper/+bug/963280
+Bug: https://issues.apache.org/jira/browse/ZOOKEEPER-1431
+
+Index: a/src/contrib/zkpython/src/c/zookeeper.c
+===================================================================
+--- a/src/contrib/zkpython/src/c/zookeeper.c	(revision 1304459)
++++ b/src/contrib/zkpython/src/c/zookeeper.c	(working copy)
+@@ -436,7 +436,8 @@
+   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL) {
+     PyErr_Print();
+   }
+-  if (pyw->permanent == 0 && (type != ZOO_SESSION_EVENT || is_unrecoverable(zzh) == ZINVALIDSTATE)) {
++  Py_DECREF(arglist);
++  if (pyw->permanent == 0 && (type != ZOO_SESSION_EVENT || is_unrecoverable(zzh) == ZINVALIDSTATE)) {   
+     free_pywatcher(pyw);
+   }
+   PyGILState_Release(gstate);
+@@ -457,6 +458,7 @@
+   PyObject *arglist = Py_BuildValue("(i,i)", pyw->zhandle, rc);
+   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL)
+     PyErr_Print();
++  Py_DECREF(arglist);
+   free_pywatcher(pyw);
+   PyGILState_Release(gstate);
+ }
+@@ -474,9 +476,9 @@
+   PyObject *pystat = build_stat(stat);
+   PyObject *arglist = Py_BuildValue("(i,i,O)", pyw->zhandle,rc, pystat);
+   Py_DECREF(pystat);
+-
+   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL)
+     PyErr_Print();
++  Py_DECREF(arglist);
+   free_pywatcher(pyw);
+   PyGILState_Release(gstate);
+ }
+@@ -498,6 +500,7 @@
+ 
+   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL)
+     PyErr_Print();
++  Py_DECREF(arglist);
+   free_pywatcher(pyw);
+   PyGILState_Release(gstate);
+ }
+@@ -518,6 +521,7 @@
+       PyObject *arglist = Py_BuildValue("(i,i,O)", pyw->zhandle, rc, pystrings);   
+       if (arglist == NULL || PyObject_CallObject((PyObject*)callback, arglist) == NULL)
+         PyErr_Print();
++      Py_DECREF(arglist);
+     }
+   else
+     PyErr_Print();
+@@ -540,6 +544,7 @@
+   PyObject *arglist = Py_BuildValue("(i,i,s)", pyw->zhandle,rc, value);
+   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL)
+     PyErr_Print();
++  Py_DECREF(arglist);
+   free_pywatcher(pyw);
+   PyGILState_Release(gstate);
+ }
+@@ -565,6 +570,7 @@
+   if (PyObject_CallObject((PyObject*)callback, arglist) == NULL) {
+     PyErr_Print();
+   }
++  Py_DECREF(arglist);
+   free_pywatcher(pyw);
+   PyGILState_Release(gstate);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index bd2f785..d4c690d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ fixes/ZOOKEEPER-705
 fixes/ZOOKEEPER-1033
 fixes/ZOOKEEPER-1374
 fixes/ZOOKEEPER-1403
+fixes/ZOOKEEPER-1431

-- 
Apache ZooKeeper



More information about the pkg-java-commits mailing list