]> granicus.if.org Git - apache/commit
We now create memory sub-pools for each DB connection and close DB
authorChris Darroch <chrisd@apache.org>
Tue, 16 Jan 2007 19:36:26 +0000 (19:36 +0000)
committerChris Darroch <chrisd@apache.org>
Tue, 16 Jan 2007 19:36:26 +0000 (19:36 +0000)
commit3d26090bc7d3413d65a463d89b7f83d98b563ee0
treece71705b95304d04c7b0236da81f540880bb555e
parentdf0aa883d50a240c5d3c7c03d605da63c6b7ad63
We now create memory sub-pools for each DB connection and close DB
connections in a pool cleanup function.  This simplifies the ap_dbd_acquire()
and ap_dbd_cacquire() functions, and also stops us from leaking ap_dbd_t
structures when using reslists.

We ensure that prepared statements are destroyed before their DB connection
is closed, in case any drivers would have problems cleaning up prepared
statements after the DB connection is closed.

The combination of reslists and memory pool cleanup functions was causing
segfaults when child processes exited, as reported in PR 39985.  To prevent
this, we register dbd_destroy() as a cleanup that will execute prior to
the internal cleanup function registered by apr_reslist_create().  When the
reslist's memory pool is destroyed, dbd_destroy() informs dbd_destruct() not
to do anything when subsequently called by the reslist's internal cleanup
function.

We avoid the use of s->process->pool (the global pool) since it isn't
destroyed by exiting child processes in most multi-process MPMs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@496831 13f79535-47bb-0310-9956-ffa450edef68
CHANGES
modules/database/mod_dbd.c