We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent908ab80 commit12bf602Copy full SHA for 12bf602
src/pl/plpython/plpython.c
@@ -3936,6 +3936,16 @@ PLy_add_exceptions(PyObject *plpy)
3936
#endif
3937
if (PyModule_AddObject(plpy,"spiexceptions",excmod)<0)
3938
PLy_elog(ERROR,"failed to add the spiexceptions module");
3939
+
3940
+/*
3941
+ * XXX it appears that in some circumstances the reference count of the
3942
+ * spiexceptions module drops to zero causing a Python assert failure when
3943
+ * the garbage collector visits the module. This has been observed on the
3944
+ * buildfarm. To fix this, add an additional ref for the module here.
3945
+ *
3946
+ * This shouldn't cause a memory leak - we don't want this garbage collected,
3947
+ * and this function shouldn't be called more than once per backend.
3948
+ */
3949
Py_INCREF(excmod);
3950
3951
PLy_exc_error=PyErr_NewException("plpy.Error",NULL,NULL);