Skip to content

Commit 04582b0

Browse files
author
Nick Kew
committed
Backport Chris's mod_dbd fixes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@569818 13f79535-47bb-0310-9956-ffa450edef68
1 parent 37e8e22 commit 04582b0

3 files changed

Lines changed: 635 additions & 467 deletions

File tree

CHANGES

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
 -*- coding: utf-8 -*-
22
Changes with Apache 2.2.6
33

4+
*) mod_dbd: Introduce configuration groups to allow inheritance by virtual
5+
hosts of database configurations from the main server. Determine the
6+
minimal set of distinct configurations and share connection pools
7+
whenever possible. Allow virtual hosts to override inherited SQL
8+
statements. PR 41302. [Chris Darroch]
9+
10+
*) mod_dbd: Create memory sub-pools for each DB connection and close
11+
DB connections in a pool cleanup function. Ensure prepared statements
12+
are destroyed before DB connection is closed. When using reslists,
13+
prevent segfaults when child processes exit, and stop memory leakage
14+
of ap_dbd_t structures. Avoid use of global s->process->pool, which
15+
isn't destroyed by exiting child processes in most multi-process MPMs.
16+
PR 39985. [Chris Darroch, Nick Kew]
17+
18+
*) mod_dbd: Handle error conditions in dbd_construct() properly.
19+
Simplify ap_dbd_open() and use correct arguments to apr_dbd_error()
20+
when non-threaded. Register correct cleanup data in non-threaded
21+
ap_dbd_acquire() and ap_dbd_cacquire(). Clean up configuration data
22+
and merge function. Use ap_log_error() wherever possible.
23+
[Chris Darroch, Nick Kew]
24+
25+
*) mod_dbd: Stash DBD connections in request_config of initial request
26+
only, or else sub-requests and internal redirections may cause
27+
entire DBD pool to be stashed in a single HTTP request. [Chris Darroch]
28+
429
*) main core: Emit errors during the initial apr_app_initialize()
530
or apr_pool_create() (when apr-based error reporting is not ready).
631
[William Rowe]

STATUS

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -122,51 +122,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
122122
I'll +1 it when that's done.
123123
wrowe: ditto's - good concept.
124124

125-
* mod_dbd: initialise resources and prepared statements in all vhosts
126-
PRs: 42327, 41302
127-
Trunk: N/A due to other changes (r503931 et al)
128-
Patch by bojan: http://issues.apache.org/bugzilla/attachment.cgi?id=20161
129-
+1: niq
130-
-1: chrisd: I think r503931 is actually the right thing to backport here,
131-
which admittedly probably requires backporting r491729, r491884,
132-
r492394 (trivial), and r496831 first. While more complex than a
133-
quick patch, I think the explanation in the fourth section of this
134-
post explains why there's no simple fix for the virtual-host
135-
inheritance issues:
136-
137-
http://marc.info/?l=apache-httpd-dev&m=116742014418304&w=2
138-
139-
Doing this work would also let us close at least three PRs.
140-
PR 42327 seems like a duplicate of 41302 (both would be closed
141-
by r503931), and r496831 would close PR 39985 as well.
142-
143-
* mod_dbd: Rename functions and variables for consistency, and move
144-
some functions around for readability, prior to making
145-
functional changes for PRs 39985, 41302, and other issues.
146-
Trunk version of patches:
147-
http://svn.apache.org/viewvc?view=rev&revision=491729
148-
http://svn.apache.org/viewvc?view=rev&revision=492394
149-
(relevant portions only)
150-
http://svn.apache.org/viewvc?view=rev&revision=521230
151-
2.2.x version of patch:
152-
http://people.apache.org/~chrisd/patches/mod_dbd_pools_groups/mod_dbd-1tidy-2.2.x.patch
153-
+1: chrisd, fuankg
154-
+1: niq (to chris's mod_dbd updates collectively)
155-
156-
* mod_dbd: Handle error conditions in dbd_construct() properly.
157-
Simplify ap_dbd_open() and use correct arguments to apr_dbd_error()
158-
when non-threaded. Register correct cleanup data in non-threaded
159-
ap_dbd_acquire() and ap_dbd_cacquire(). Clean up configuration data
160-
and merge function. Use ap_log_error() wherever possible.
161-
Trunk version of patches:
162-
http://svn.apache.org/viewvc?view=rev&revision=491884
163-
http://svn.apache.org/viewvc?view=rev&revision=492394
164-
(relevant portions only)
165-
2.2.x version of patch:
166-
http://people.apache.org/~chrisd/patches/mod_dbd_pools_groups/mod_dbd-2misc-2.2.x.patch
167-
+1: chrisd, fuankg
168-
+1: niq (to chris's mod_dbd updates collectively)
169-
170125
* beos MPM: Create pmain pool and run modules' child_init hooks when
171126
entering ap_mpm_run(), then destroy pmain when exiting ap_mpm_run().
172127
Otherwise modules' child_init hooks appear to never be executed.
@@ -178,42 +133,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK:
178133
http://people.apache.org/~chrisd/patches/mod_dbd_pools_groups/mpm_child_init-beos-2.2.x.patch
179134
+0: chrisd (abstaining; unable to test)
180135

181-
* mod_dbd: Create memory sub-pools for each DB connection and close
182-
DB connections in a pool cleanup function. Ensure prepared statements
183-
are destroyed before DB connection is closed. When using reslists,
184-
prevent segfaults when child processes exit, and stop memory leakage
185-
of ap_dbd_t structures. Avoid use of global s->process->pool, which
186-
isn't destroyed by exiting child processes in most multi-process MPMs.
187-
See also the third section of:
188-
http://marc.info/?l=apache-httpd-dev&m=116742014418304&w=2
189-
and the eventual solution as described in the comments in the
190-
dbd_setup() function.
191-
PR: 39985
192-
Trunk version of patch:
193-
http://svn.apache.org/viewvc?view=rev&revision=496831
194-
2.2.x version of patch:
195-
http://people.apache.org/~chrisd/patches/mod_dbd_pools_groups/mod_dbd-3pools-2.2.x.patch
196-
+1: chrisd, fuankg
197-
+1: niq (to chris's mod_dbd updates collectively)
198-
199-
* mod_dbd: Introduce configuration groups to allow inheritance by virtual
200-
hosts of database configurations from the main server. Determine the
201-
minimal set of distinct configurations and share connection pools
202-
whenever possible. Allow virtual hosts to override inherited SQL
203-
statements. See also the fourth section of:
204-
http://marc.info/?l=apache-httpd-dev&m=116742014418304&w=2
205-
and the eventual solution as implemented in the dbd_post_config()
206-
function. Obviates r424798, r432560, r432562, and r466641.
207-
Could be improved by the addition of <DBDGroup> configuration
208-
sections. (Any takers? :-)
209-
PR: 41302
210-
Trunk version of patch:
211-
http://svn.apache.org/viewvc?view=rev&revision=503931
212-
2.2.x version of patch:
213-
http://people.apache.org/~chrisd/patches/mod_dbd_pools_groups/mod_dbd-4groups-2.2.x.patch
214-
+1: chrisd, fuankg
215-
+1: niq (to chris's mod_dbd updates collectively)
216-
217136
* mod_proxy: Improve traces in ap_proxy_http_process_response()
218137
to investigate PR37770.
219138
Trunk version of patch:

0 commit comments

Comments
 (0)