[Zodb-checkins] SVN: ZODB/trunk/src/ Bug fixed

Jim Fulton jim at zope.com
Fri Sep 24 11:12:47 EDT 2010


Log message for revision 116786:
  Bug fixed
  - Changes in way that garage collection treats dictionaries in Python
    2.7 broke the object/connection cache implementation.
    (https://bugs.launchpad.net/zodb/+bug/641481)
  

Changed:
  U   ZODB/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/persistent/cPickleCache.c

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2010-09-24 11:52:41 UTC (rev 116785)
+++ ZODB/trunk/src/CHANGES.txt	2010-09-24 15:12:47 UTC (rev 116786)
@@ -8,6 +8,10 @@
 Bugs fixed
 ----------
 
+- Changes in way that garage collection treats dictionaries in Python
+  2.7 broke the object/connection cache implementation.
+  (https://bugs.launchpad.net/zodb/+bug/641481)
+
 - Updated the 'repozo --kill-old-on-full' option to remove any '.index'
   files corresponding to backups being removed.
 

Modified: ZODB/trunk/src/persistent/cPickleCache.c
===================================================================
--- ZODB/trunk/src/persistent/cPickleCache.c	2010-09-24 11:52:41 UTC (rev 116785)
+++ ZODB/trunk/src/persistent/cPickleCache.c	2010-09-24 15:12:47 UTC (rev 116786)
@@ -767,6 +767,7 @@
         return NULL;
       if (PyDict_SetItem(self->data, key, v) < 0)
         return NULL;
+      PyObject_GC_UnTrack((void *)self->data);
       self->klass_count++;
     }
   else
@@ -782,6 +783,7 @@
       if (PyDict_SetItem(self->data, key, v) < 0)
         return NULL;
       /* the dict should have a borrowed reference */
+      PyObject_GC_UnTrack((void *)self->data);
       Py_DECREF(v);
 
       Py_INCREF(self);
@@ -1098,6 +1100,7 @@
     {
       if (PyDict_SetItem(self->data, key, v) < 0)
         return -1;
+      PyObject_GC_UnTrack((void *)self->data);
       self->klass_count++;
       return 0;
     }
@@ -1123,6 +1126,7 @@
   if (PyDict_SetItem(self->data, key, v) < 0)
     return -1;
   /* the dict should have a borrowed reference */
+  PyObject_GC_UnTrack((void *)self->data);
   Py_DECREF(v);
 
   p = (cPersistentObject *)v;



More information about the Zodb-checkins mailing list