hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ph...@apache.org
Subject svn commit: r820850 - in /hadoop/zookeeper/trunk: CHANGES.txt src/contrib/zkpython/src/c/zookeeper.c
Date Fri, 02 Oct 2009 00:26:15 GMT
Author: phunt
Date: Fri Oct  2 00:26:14 2009
New Revision: 820850

URL: http://svn.apache.org/viewvc?rev=820850&view=rev
Log:
ZOOKEEPER-538. zookeeper.async causes python to segfault

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

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=820850&r1=820849&r2=820850&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Fri Oct  2 00:26:14 2009
@@ -79,6 +79,9 @@
   ZOOKEEPER-420. build/test should not require install in zkpython
   (henry robinson via phunt)
 
+  ZOOKEEPER-538. zookeeper.async causes python to segfault
+  (henry robinson via phunt)
+
 IMPROVEMENTS:
   ZOOKEEPER-473. cleanup junit tests to eliminate false positives due to
   "socket reuse" and failure to close client (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=820850&r1=820849&r2=820850&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c (original)
+++ hadoop/zookeeper/trunk/src/contrib/zkpython/src/c/zookeeper.c Fri Oct  2 00:26:14 2009
@@ -205,6 +205,8 @@
 {
   PyGILState_STATE gstate;
   pywatcher_t *pyw = (pywatcher_t*)data;
+  if (pyw == NULL)
+    return;
   PyObject *callback = pyw->callback;
   gstate = PyGILState_Ensure();
   PyObject *arglist = Py_BuildValue("(i,i)", pyw->zhandle, rc);
@@ -218,6 +220,8 @@
 {
   PyGILState_STATE gstate;
   pywatcher_t *pyw = (pywatcher_t*)data;
+  if (pyw == NULL)
+    return;
   PyObject *callback = pyw->callback;
   gstate = PyGILState_Ensure();
   PyObject *arglist = Py_BuildValue("(i,i,N)", pyw->zhandle,rc, build_stat(stat));
@@ -231,6 +235,8 @@
 {
   PyGILState_STATE gstate;
   pywatcher_t *pyw = (pywatcher_t*)data;
+  if (pyw == NULL)
+    return;
   PyObject *callback = pyw->callback;
   gstate = PyGILState_Ensure();
   PyObject *arglist = Py_BuildValue("(i,i,s#,O)", pyw->zhandle,rc, value,value_len, build_stat(stat));
@@ -244,6 +250,8 @@
 {
   PyGILState_STATE gstate;
   pywatcher_t *pyw = (pywatcher_t*)data;
+  if (pyw == NULL)
+    return;
   PyObject *callback = pyw->callback;
   gstate = PyGILState_Ensure();
   PyObject *arglist = Py_BuildValue("(i,i,O)", pyw->zhandle,rc, build_string_vector(strings));
@@ -257,6 +265,8 @@
 {
   PyGILState_STATE gstate;
   pywatcher_t *pyw = (pywatcher_t*)data;
+  if (pyw == NULL)
+    return;
   PyObject *callback = pyw->callback;
   gstate = PyGILState_Ensure();
   PyObject *arglist = Py_BuildValue("(i,i,s)", pyw->zhandle,rc, value);
@@ -270,6 +280,8 @@
 {
   PyGILState_STATE gstate;
   pywatcher_t *pyw = (pywatcher_t*)data;
+  if (pyw == NULL)
+    return;
   PyObject *callback = pyw->callback;
   gstate = PyGILState_Ensure();
   PyObject *arglist = Py_BuildValue("(i,i,O,O)", pyw->zhandle,rc, build_acls(acl), build_stat(stat));
@@ -299,7 +311,7 @@
 			 valuelen,
 			 pyacls == Py_None ? NULL : &acl,
 			 flags,
-			 completion_callback != Py_None ? string_completion_dispatch : NULL,
+			 string_completion_dispatch,
 			 completion_callback != Py_None ? create_pywatcher(zkhid, completion_callback,0 ) : NULL
);
     
   free_acls(&acl);
@@ -322,7 +334,7 @@
   int err = zoo_adelete( zhandles[zkhid],
 			 path,
 			 version,
-			 completion_callback != Py_None ? void_completion_dispatch : NULL,
+			 void_completion_dispatch,
 			 completion_callback != Py_None ? create_pywatcher(zkhid, 
 									   completion_callback,
 									   0 ) : NULL );
@@ -349,7 +361,7 @@
 			  path,
 			  exists_watch != Py_None ? watcher_dispatch : NULL,
 			  exists_watch != Py_None ? create_pywatcher(zkhid, exists_watch,0) : NULL,
-			  (completion_callback != Py_None) ? stat_completion_dispatch : NULL,
+			  stat_completion_dispatch,
 			  (completion_callback != Py_None) ? create_pywatcher(zkhid, completion_callback,0) :
NULL );
     
   if (err != ZOK)
@@ -374,7 +386,7 @@
 		       path,
 		       get_watch != Py_None ? watcher_dispatch : NULL,
 		       get_watch != Py_None ? create_pywatcher(zkhid, get_watch,0) : NULL,
-		       completion_callback != Py_None ? data_completion_dispatch : NULL,
+		       data_completion_dispatch,
 		       completion_callback != Py_None ? 
 		       create_pywatcher(zkhid, completion_callback,0 ) : NULL );
     
@@ -399,7 +411,7 @@
 		      buffer,
 		      buflen,
 		      version,
-		      completion_callback != Py_None ? stat_completion_dispatch : NULL,
+		      stat_completion_dispatch,
 		      completion_callback != Py_None ? create_pywatcher(zkhid, 
 									completion_callback,
 									0 ) : NULL );
@@ -426,7 +438,7 @@
 				path,
 				get_watch != Py_None ? watcher_dispatch : NULL,
 				get_watch != Py_None ? create_pywatcher(zkhid, get_watch,0) : NULL,
-				completion_callback != Py_None ? strings_completion_dispatch : NULL,
+				strings_completion_dispatch,
 				completion_callback != Py_None ? 
 				create_pywatcher(zkhid, completion_callback,0) : NULL );    
   if (err != ZOK)
@@ -448,7 +460,7 @@
 
   int err = zoo_async( zhandles[zkhid],
 		       path,
-		       completion_callback != Py_None ? string_completion_dispatch : NULL,
+		       string_completion_dispatch,
 		       completion_callback != Py_None ? 
 		       create_pywatcher(zkhid, completion_callback,0) : NULL );    
   if (err != ZOK)
@@ -470,7 +482,7 @@
 
   int err = zoo_aget_acl( zhandles[zkhid],
 			  path,
-			  completion_callback != Py_None ? acl_completion_dispatch : NULL,
+			  acl_completion_dispatch,
 			  completion_callback != Py_None ? 
 			  create_pywatcher(zkhid, completion_callback,0) : NULL );
     
@@ -497,7 +509,7 @@
 			  path,
 			  version,
 			  &aclv,
-			  completion_callback != Py_None ? void_completion_dispatch : NULL,
+			  void_completion_dispatch,
 			  completion_callback != Py_None ? 
 			  create_pywatcher(zkhid, completion_callback,0) : NULL );
   free_acls(&aclv);



Mime
View raw message