summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan2011-03-04 00:41:54 +0000
committerAndrew Dunstan2011-03-04 00:41:54 +0000
commit12bf602f3fe963a9d155778b9385186c3a0b5ed3 (patch)
treeaa13fa9877da52942852bf0a0de0c2306dd88f1f /src
parent908ab80286401bb20a519fa7dc7a837631f20369 (diff)
Add a comment explaining the recent fix for plpython breakage in commit 4c966d9.
Mostly text supplied by Jan UrbaƄski.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/plpython.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index a2ebd22428c..75f7b5cf57f 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -3936,6 +3936,16 @@ PLy_add_exceptions(PyObject *plpy)
#endif
if (PyModule_AddObject(plpy, "spiexceptions", excmod) < 0)
PLy_elog(ERROR, "failed to add the spiexceptions module");
+
+/*
+ * XXX it appears that in some circumstances the reference count of the
+ * spiexceptions module drops to zero causing a Python assert failure when
+ * the garbage collector visits the module. This has been observed on the
+ * buildfarm. To fix this, add an additional ref for the module here.
+ *
+ * This shouldn't cause a memory leak - we don't want this garbage collected,
+ * and this function shouldn't be called more than once per backend.
+ */
Py_INCREF(excmod);
PLy_exc_error = PyErr_NewException("plpy.Error", NULL, NULL);