Skip to content

Commit 9a49a0c

Browse files
Merge branch 'release/4.1.2'
2 parents 14b71d2 + 89d82c3 commit 9a49a0c

File tree

7 files changed

+51
-10
lines changed

7 files changed

+51
-10
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.1.2.rst
89
version-4.1.1.rst
910
version-4.1.0.rst
1011

docs/release-notes/version-4.1.2.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
=============
2+
Version 4.1.2
3+
=============
4+
5+
Version 4.1.2 of mod_wsgi can be obtained from:
6+
7+
https://github.com/GrahamDumpleton/mod_wsgi/archive/4.1.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. The integration for Django management command was looking for the wrong
21+
name for the admin script to start mod_wsgi express.
22+
23+
2. The code which connected to the mod_wsgi daemon process was passing an
24+
incorrect size into the connect() call for the size of the address
25+
structure. On some Linux systems this would cause an error similar to::
26+
27+
(22)Invalid argument: mod_wsgi (pid=22944): Unable to connect to \
28+
WSGI daemon process 'localhost:8000' on \
29+
'/tmp/mod_wsgi-localhost:8000:12145/wsgi.22942.0.1.sock'
30+
31+
This issue was only introduced in 4.1.0 and does not affect older versions.
32+
33+
3. The deadlock detection thread could try and acquire the Python GIL
34+
after the Python interpreter had been destroyed on Python shutdown
35+
resulting in the process crashing. This issue cannot be completely
36+
eliminated, but the deadlock thread will now at least check whether the
37+
flag indicating process shutdown is happening has been set before trying to
38+
acquire the Python GIL.

src/server/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def generate_wdb_server_script(options):
704704
"""
705705

706706
def generate_control_scripts(options):
707-
path = os.path.join(options['server_root'], 'server-admin')
707+
path = os.path.join(options['server_root'], 'apachectl')
708708
with open(path, 'w') as fp:
709709
print(WSGI_CONTROL_SCRIPT.lstrip() % options, file=fp)
710710

@@ -1183,7 +1183,7 @@ def cmd_start_server(params):
11831183

11841184
options = cmd_setup_server(params, usage)
11851185

1186-
executable = os.path.join(options['server_root'], 'server-admin')
1186+
executable = os.path.join(options['server_root'], 'apachectl')
11871187
name = executable.ljust(len(options['process_name']))
11881188
os.execl(executable, name, 'start', '-DNO_DETACH')
11891189

src/server/management/commands/runmodwsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ def handle(self, *args, **options):
4646

4747
options = mod_wsgi.server._cmd_setup_server(args, options)
4848

49-
executable = os.path.join(options['server_root'], 'wsgi-server')
49+
executable = os.path.join(options['server_root'], 'apachectl')
5050
name = executable.ljust(len(options['process_name']))
5151
os.execl(executable, name, 'start', '-DNO_DETACH')

src/server/mod_wsgi.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7846,8 +7846,10 @@ static void *wsgi_deadlock_thread(apr_thread_t *thd, void *data)
78467846
while (1) {
78477847
apr_sleep(apr_time_from_sec(1));
78487848

7849-
gilstate = PyGILState_Ensure();
7850-
PyGILState_Release(gilstate);
7849+
if (!wsgi_daemon_shutdown) {
7850+
gilstate = PyGILState_Ensure();
7851+
PyGILState_Release(gilstate);
7852+
}
78517853

78527854
apr_thread_mutex_lock(wsgi_monitor_lock);
78537855
wsgi_deadlock_shutdown_time = apr_time_now();
@@ -9204,8 +9206,7 @@ static apr_status_t wsgi_socket_connect_un(apr_socket_t *sock,
92049206
}
92059207

92069208
do {
9207-
rv = connect(rawsock, (struct sockaddr*)sa,
9208-
sizeof(*sa) + strlen(sa->sun_path));
9209+
rv = connect(rawsock, (struct sockaddr*)sa, sizeof(*sa));
92099210
} while (rv == -1 && errno == EINTR);
92109211

92119212
if ((rv == -1) && (errno == EINPROGRESS || errno == EALREADY)
@@ -9249,7 +9250,7 @@ static int wsgi_connect_daemon(request_rec *r, WSGIDaemonSocket *daemon)
92499250

92509251
memset(&addr, 0, sizeof(addr));
92519252
addr.sun_family = AF_UNIX;
9252-
apr_cpystrn(addr.sun_path, daemon->socket_path, sizeof addr.sun_path);
9253+
apr_cpystrn(addr.sun_path, daemon->socket_path, sizeof(addr.sun_path));
92539254

92549255
start_time = apr_time_now();
92559256

src/server/wsgi_apache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include "apr_version.h"
7272
#include "apr_buckets.h"
7373
#include "apr_date.h"
74+
#include "mpm_common.h"
7475

7576
#include "apr_optional.h"
7677

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 1
28-
#define MOD_WSGI_MICROVERSION_NUMBER 0
29-
#define MOD_WSGI_VERSION_STRING "4.1.1"
28+
#define MOD_WSGI_MICROVERSION_NUMBER 2
29+
#define MOD_WSGI_VERSION_STRING "4.1.2"
3030

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

0 commit comments

Comments
 (0)