File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -3936,6 +3936,16 @@ PLy_add_exceptions(PyObject *plpy)
39363936#endif
39373937 if (PyModule_AddObject (plpy , "spiexceptions" , excmod ) < 0 )
39383938 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+ */
39393949 Py_INCREF (excmod );
39403950
39413951 PLy_exc_error = PyErr_NewException ("plpy.Error" , NULL , NULL );
You can’t perform that action at this time.
0 commit comments