Skip to content

Commit f7307a7

Browse files
Merge branch 'release/4.3.2'
2 parents a3d607a + 8dfdc04 commit f7307a7

File tree

7 files changed

+262
-288
lines changed

7 files changed

+262
-288
lines changed

docs/release-notes/index.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+
version-4.3.2.rst
89
version-4.3.1.rst
910
version-4.3.0.rst
1011

docs/release-notes/version-4.3.2.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
=============
2+
Version 4.3.2
3+
=============
4+
5+
Version 4.3.2 of mod_wsgi can be obtained from:
6+
7+
https://github.com/GrahamDumpleton/mod_wsgi/archive/4.3.2.tar.gz
8+
9+
Known Issues
10+
------------
11+
12+
1. The makefiles for building mod_wsgi on Windows are currently broken and
13+
need updating. As most new changes relate to mod_wsgi daemon mode, which is
14+
not supported under Windows, you should keep using the last available
15+
binary for version 3.X on Windows instead.
16+
17+
Bugs Fixed
18+
----------
19+
20+
1. Linux behaviour when using ``connect()`` on a non blocking UNIX socket
21+
and the listener queue is full, is apparently not POSIX compliant and it
22+
returns ``EAGAIN`` instead of ``ECONNREFUSED``. The code handling errors
23+
from the ``connect()`` wasn't accomodating this non standard behaviour
24+
and so would fail immediately rather than retrying.
25+
26+
2. Only change working directory for mod_wsgi daemon process after having
27+
dropped privileges to target user. This is required where the specified
28+
working directory is on an NFS file system configured so as not to have
29+
root access priviliges.
30+
31+
3. The workaround for getting pyvenv style virtual environments to work
32+
with Python 3.3+ would break brew Python 2.7 on MacOS X as brew Python
33+
appears to not work in embedded systems which use Py_SetProgramName()
34+
instead of using Py_SetPythonHome(). Now only use Py_SetProgramName() if
35+
detect it is actually a pyvenv style virtual environment. This even appears
36+
to be okay for brew Python 3.4 at least as it does still work with the
37+
Py_SetProgramName() call even if brew Python 2.7 doesn't.
38+
39+
New Features
40+
------------
41+
42+
1. If the ``WSGIPythonHome`` directive or the ``python-home`` option is
43+
used with the ``WSGIDaemonProcess`` directive, the path provided, which is
44+
supposed to be the root directory of the Python installation or virtual
45+
environment, will be checked to see if it is actually accessible and refers
46+
to a directory. If it isn't, a warning message will be logged along with
47+
any details providing an indication of what may be wrong with the supplied
48+
path.
49+
50+
This is being done to warn when an invalid path has been supplied that
51+
subsequently is likely to be rejected and ignored by the Python
52+
interpreter. In such a situation where an invalid path is supplied the
53+
Python interpreter doesn't actually log anything and will instead silently
54+
fallback to using any Python installation it finds by seaching for
55+
``python`` on the users ``PATH``. This may not be the Python installation
56+
or virtual environment you intended be used.
57+
58+
2. The Apache configuration snippet generated as an example when running
59+
the ``install-module`` sub command of ``mod_wsgi-express`` to install the
60+
``mod_wsgi.so`` into the Apache installation itself, will now output a
61+
``WSGIPythonHome`` directive for the Python installation or virtual
62+
environment the mod_wsgi module was compiled against so that the correct
63+
Python runtime will be used.

src/server/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,14 +1760,14 @@ def _cmd_setup_server(command, args, options):
17601760
if options['max_clients'] is not None:
17611761
max_clients = max(options['max_clients'], max_clients)
17621762
else:
1763-
max_clients = int(1.5 * max_clients)
1763+
max_clients = 10 + max(10, int(1.5 * max_clients))
17641764

17651765
initial_workers = options['initial_workers']
17661766
min_spare_workers = options['minimum_spare_workers']
17671767
max_spare_workers = options['maximum_spare_workers']
17681768

17691769
if initial_workers is None:
1770-
prefork_initial_workers = 0.02
1770+
prefork_initial_workers = 0.05
17711771
else:
17721772
prefork_initial_workers = initial_workers
17731773

@@ -1777,7 +1777,7 @@ def _cmd_setup_server(command, args, options):
17771777
prefork_min_spare_workers = min_spare_workers
17781778

17791779
if max_spare_workers is None:
1780-
prefork_max_spare_workers = 0.05
1780+
prefork_max_spare_workers = 0.1
17811781
else:
17821782
prefork_max_spare_workers = max_spare_workers
17831783

@@ -1807,11 +1807,11 @@ def _cmd_setup_server(command, args, options):
18071807

18081808
options['worker_max_clients'] = max_clients
18091809

1810-
if max_clients > 25:
1810+
if max_clients > 20:
18111811
options['worker_threads_per_child'] = int(max_clients /
1812-
(int(max_clients / 25) + 1))
1812+
(int(max_clients / 20) + 1))
18131813
else:
1814-
options['worker_threads_per_child'] = max_clients
1814+
options['worker_threads_per_child'] = 10
18151815

18161816
options['worker_thread_limit'] = options['worker_threads_per_child']
18171817

@@ -2003,6 +2003,7 @@ def cmd_install_module(params):
20032003
shutil.copyfile(where(), target)
20042004

20052005
print('LoadModule wsgi_module %s' % target)
2006+
print('WSGIPythonHome %s' % os.path.normpath(sys.prefix))
20062007

20072008
def cmd_module_location(params):
20082009
formatter = optparse.IndentedHelpFormatter()

0 commit comments

Comments
 (0)