Skip to content

Commit 538cf8f

Browse files
Merge branch 'release/4.5.24'
2 parents 84d1c16 + ba1fc6e commit 538cf8f

File tree

6 files changed

+108
-7
lines changed

6 files changed

+108
-7
lines changed

docs/configuration-directives/WSGIScriptAlias.rst

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WSGIScriptAlias
33
===============
44

55
:Description: Maps a URL to a filesystem location and designates the target as a WSGI script.
6-
:Syntax: ``WSGIScriptAlias`` *URL-path file-path|directory-path*
6+
:Syntax: ``WSGIScriptAlias`` *URL-path file-path|directory-path* ``[`` *options* ``]``
77
:Context: server config, virtual host
88

99
The WSGIScriptAlias directive behaves in the same manner as the
@@ -59,6 +59,44 @@ location, potentially bypassing the WSGIScriptAlias and revealing the
5959
source code of the WSGI scripts if they are not restricted by a
6060
`<Directory>`_ section.
6161

62+
Options which can be supplied to the ``WSGIScriptAlias`` directive are:
63+
64+
**process-group=name**
65+
Defines which process group the WSGI application will be executed
66+
in. All WSGI applications within the same process group will execute
67+
within the context of the same group of daemon processes.
68+
69+
If the name is set to be ``%{GLOBAL}`` the process group name will
70+
be set to the empty string. Any WSGI applications in the global
71+
process group will always be executed within the context of the
72+
standard Apache child processes. Such WSGI applications will incur
73+
the least runtime overhead, however, they will share the same
74+
process space with other Apache modules such as PHP, as well as the
75+
process being used to serve up static file content. Running WSGI
76+
applications within the standard Apache child processes will also
77+
mean the application will run as the user that Apache would normally
78+
run as.
79+
80+
**application-group=name**
81+
Defines which application group a WSGI application or set of WSGI
82+
applications belongs to. All WSGI applications within the same
83+
application group will execute within the context of the same Python
84+
sub interpreter of the process handling the request.
85+
86+
If the name is set to be ``%{GLOBAL}`` the application group will be
87+
set to the empty string. Any WSGI applications in the global
88+
application group will always be executed within the context of the
89+
first interpreter created by Python when it is initialised. Forcing
90+
a WSGI application to run within the first interpreter can be
91+
necessary when a third party C extension module for Python has used
92+
the simplified threading API for manipulation of the Python GIL and
93+
thus will not run correctly within any additional sub interpreters
94+
created by Python.
95+
96+
If both ``process-group`` and ``application-group`` options are set, the
97+
WSGI script file will be pre-loaded when the process it is to run in is
98+
started, rather than being lazily loaded on the first request.
99+
62100
.. _Alias: http://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias
63101
.. _DocumentRoot: http://httpd.apache.org/docs/2.2/mod/core.html#documentroot
64102
.. _<Directory>: http://httpd.apache.org/docs/2.2/mod/core.html#directory

docs/configuration-directives/WSGIScriptAliasMatch.rst

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WSGIScriptAliasMatch
33
====================
44

55
:Description: Maps a URL to a filesystem location and designates the target as a WSGI script.
6-
:Syntax: ``WSGIScriptAliasMatch`` *regex file-path|directory-path*
6+
:Syntax: ``WSGIScriptAliasMatch`` *regex file-path|directory-path* ``[`` *options* ``]``
77
:Context: server config, virtual host
88

99
This directive is similar to the WSGIScriptAlias directive, but makes use
@@ -31,3 +31,41 @@ critical.
3131
If you think you need to use WSGIScriptAliasMatch, you probably don't
3232
really. If you really really think you need it, then check on the mod_wsgi
3333
mailing list about how to use it properly.
34+
35+
Options which can be supplied to the ``WSGIScriptAlias`` directive are:
36+
37+
**process-group=name**
38+
Defines which process group the WSGI application will be executed
39+
in. All WSGI applications within the same process group will execute
40+
within the context of the same group of daemon processes.
41+
42+
If the name is set to be ``%{GLOBAL}`` the process group name will
43+
be set to the empty string. Any WSGI applications in the global
44+
process group will always be executed within the context of the
45+
standard Apache child processes. Such WSGI applications will incur
46+
the least runtime overhead, however, they will share the same
47+
process space with other Apache modules such as PHP, as well as the
48+
process being used to serve up static file content. Running WSGI
49+
applications within the standard Apache child processes will also
50+
mean the application will run as the user that Apache would normally
51+
run as.
52+
53+
**application-group=name**
54+
Defines which application group a WSGI application or set of WSGI
55+
applications belongs to. All WSGI applications within the same
56+
application group will execute within the context of the same Python
57+
sub interpreter of the process handling the request.
58+
59+
If the name is set to be ``%{GLOBAL}`` the application group will be
60+
set to the empty string. Any WSGI applications in the global
61+
application group will always be executed within the context of the
62+
first interpreter created by Python when it is initialised. Forcing
63+
a WSGI application to run within the first interpreter can be
64+
necessary when a third party C extension module for Python has used
65+
the simplified threading API for manipulation of the Python GIL and
66+
thus will not run correctly within any additional sub interpreters
67+
created by Python.
68+
69+
If both ``process-group`` and ``application-group`` options are set, the
70+
WSGI script file will be pre-loaded when the process it is to run in is
71+
started, rather than being lazily loaded on the first request.

docs/release-notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Release Notes
55
.. toctree::
66
:maxdepth: 2
77

8+
release-notes/version-4.5.24
89
release-notes/version-4.5.23
910
release-notes/version-4.5.22
1011
release-notes/version-4.5.21
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
==============
2+
Version 4.5.24
3+
==============
4+
5+
Version 4.5.24 of mod_wsgi can be obtained from:
6+
7+
https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.5.24
8+
9+
Bugs Fixed
10+
----------
11+
12+
* Using mod_wsgi in daemon mode on Solaris would cause a process hang or
13+
max out CPU usage. Caused by change of variable type to unsigned to get
14+
rid of compiler warnings, without fixing how condition check using
15+
variable was done.
16+
17+
Problem could also affect non Solaris systems if total number of HTTP
18+
headers and other variables passed in WSGI environ was greater than 1024.
19+
Affected Solaris all the time due to it having a limit of only 16 in
20+
operating system for same code, meaning hit problem immediately.

src/server/mod_wsgi.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10709,7 +10709,7 @@ static apr_status_t wsgi_socket_sendv(apr_socket_t *sock, struct iovec *vec,
1070910709
if (nvec > iov_max) {
1071010710
int offset = 0;
1071110711

10712-
while (nvec > 0) {
10712+
while (nvec != 0) {
1071310713
apr_status_t rv;
1071410714

1071510715
rv = wsgi_socket_sendv_limit(sock, &vec[offset],
@@ -10718,8 +10718,12 @@ static apr_status_t wsgi_socket_sendv(apr_socket_t *sock, struct iovec *vec,
1071810718
if (rv != APR_SUCCESS)
1071910719
return rv;
1072010720

10721-
nvec -= iov_max;
10722-
offset += iov_max;
10721+
if (nvec > iov_max) {
10722+
nvec -= iov_max;
10723+
offset += iov_max;
10724+
} else {
10725+
nvec = 0;
10726+
}
1072310727
}
1072410728

1072510729
return APR_SUCCESS;

src/server/wsgi_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#define MOD_WSGI_MAJORVERSION_NUMBER 4
2727
#define MOD_WSGI_MINORVERSION_NUMBER 5
28-
#define MOD_WSGI_MICROVERSION_NUMBER 23
29-
#define MOD_WSGI_VERSION_STRING "4.5.23"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 24
29+
#define MOD_WSGI_VERSION_STRING "4.5.24"
3030

3131
/* ------------------------------------------------------------------------- */
3232

0 commit comments

Comments
 (0)