summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-05-31 21:42:33 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2014-05-31 21:42:33 +1000
commit9a49a0c9073f58e2f42141f972f0c5e9d9e2c4cb (patch)
treee6eae40168afcdf08155182373d43b3cea06a437
parent14b71d26dcc6b997050d18bdb7e65f55d31e36ff (diff)
parent89d82c3dabf56ad1c2f1fdb4b1038f1ef953d610 (diff)
downloadmod_wsgi-9a49a0c9073f58e2f42141f972f0c5e9d9e2c4cb.tar.gz
Merge branch 'release/4.1.2'4.1.2
-rw-r--r--docs/release-notes/index.rst1
-rw-r--r--docs/release-notes/version-4.1.2.rst38
-rw-r--r--src/server/__init__.py4
-rw-r--r--src/server/management/commands/runmodwsgi.py2
-rw-r--r--src/server/mod_wsgi.c11
-rw-r--r--src/server/wsgi_apache.h1
-rw-r--r--src/server/wsgi_version.h4
7 files changed, 51 insertions, 10 deletions
diff --git a/docs/release-notes/index.rst b/docs/release-notes/index.rst
index 51e234d..f0e1bdd 100644
--- a/docs/release-notes/index.rst
+++ b/docs/release-notes/index.rst
@@ -5,6 +5,7 @@ Release Notes
.. toctree::
:maxdepth: 2
+ version-4.1.2.rst
version-4.1.1.rst
version-4.1.0.rst
diff --git a/docs/release-notes/version-4.1.2.rst b/docs/release-notes/version-4.1.2.rst
new file mode 100644
index 0000000..e533c3f
--- /dev/null
+++ b/docs/release-notes/version-4.1.2.rst
@@ -0,0 +1,38 @@
+=============
+Version 4.1.2
+=============
+
+Version 4.1.2 of mod_wsgi can be obtained from:
+
+ https://github.com/GrahamDumpleton/mod_wsgi/archive/4.1.2.tar.gz
+
+Known Issues
+------------
+
+1. The makefiles for building mod_wsgi on Windows are currently broken and
+need updating. As most new changes relate to mod_wsgi daemon mode, which is
+not supported under Windows, you should keep using the last available
+binary for version 3.X on Windows instead.
+
+Bugs Fixed
+----------
+
+1. The integration for Django management command was looking for the wrong
+name for the admin script to start mod_wsgi express.
+
+2. The code which connected to the mod_wsgi daemon process was passing an
+incorrect size into the connect() call for the size of the address
+structure. On some Linux systems this would cause an error similar to::
+
+ (22)Invalid argument: mod_wsgi (pid=22944): Unable to connect to \
+ WSGI daemon process 'localhost:8000' on \
+ '/tmp/mod_wsgi-localhost:8000:12145/wsgi.22942.0.1.sock'
+
+This issue was only introduced in 4.1.0 and does not affect older versions.
+
+3. The deadlock detection thread could try and acquire the Python GIL
+after the Python interpreter had been destroyed on Python shutdown
+resulting in the process crashing. This issue cannot be completely
+eliminated, but the deadlock thread will now at least check whether the
+flag indicating process shutdown is happening has been set before trying to
+acquire the Python GIL.
diff --git a/src/server/__init__.py b/src/server/__init__.py
index 286e9ba..ffeb0d3 100644
--- a/src/server/__init__.py
+++ b/src/server/__init__.py
@@ -704,7 +704,7 @@ APACHE_ENVVARS_FILE = """
"""
def generate_control_scripts(options):
- path = os.path.join(options['server_root'], 'server-admin')
+ path = os.path.join(options['server_root'], 'apachectl')
with open(path, 'w') as fp:
print(WSGI_CONTROL_SCRIPT.lstrip() % options, file=fp)
@@ -1183,7 +1183,7 @@ def cmd_start_server(params):
options = cmd_setup_server(params, usage)
- executable = os.path.join(options['server_root'], 'server-admin')
+ executable = os.path.join(options['server_root'], 'apachectl')
name = executable.ljust(len(options['process_name']))
os.execl(executable, name, 'start', '-DNO_DETACH')
diff --git a/src/server/management/commands/runmodwsgi.py b/src/server/management/commands/runmodwsgi.py
index c1b64b3..1248526 100644
--- a/src/server/management/commands/runmodwsgi.py
+++ b/src/server/management/commands/runmodwsgi.py
@@ -46,6 +46,6 @@ class Command(BaseCommand):
options = mod_wsgi.server._cmd_setup_server(args, options)
- executable = os.path.join(options['server_root'], 'wsgi-server')
+ executable = os.path.join(options['server_root'], 'apachectl')
name = executable.ljust(len(options['process_name']))
os.execl(executable, name, 'start', '-DNO_DETACH')
diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c
index 920cc5d..a09027f 100644
--- a/src/server/mod_wsgi.c
+++ b/src/server/mod_wsgi.c
@@ -7846,8 +7846,10 @@ static void *wsgi_deadlock_thread(apr_thread_t *thd, void *data)
while (1) {
apr_sleep(apr_time_from_sec(1));
- gilstate = PyGILState_Ensure();
- PyGILState_Release(gilstate);
+ if (!wsgi_daemon_shutdown) {
+ gilstate = PyGILState_Ensure();
+ PyGILState_Release(gilstate);
+ }
apr_thread_mutex_lock(wsgi_monitor_lock);
wsgi_deadlock_shutdown_time = apr_time_now();
@@ -9204,8 +9206,7 @@ static apr_status_t wsgi_socket_connect_un(apr_socket_t *sock,
}
do {
- rv = connect(rawsock, (struct sockaddr*)sa,
- sizeof(*sa) + strlen(sa->sun_path));
+ rv = connect(rawsock, (struct sockaddr*)sa, sizeof(*sa));
} while (rv == -1 && errno == EINTR);
if ((rv == -1) && (errno == EINPROGRESS || errno == EALREADY)
@@ -9249,7 +9250,7 @@ static int wsgi_connect_daemon(request_rec *r, WSGIDaemonSocket *daemon)
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
- apr_cpystrn(addr.sun_path, daemon->socket_path, sizeof addr.sun_path);
+ apr_cpystrn(addr.sun_path, daemon->socket_path, sizeof(addr.sun_path));
start_time = apr_time_now();
diff --git a/src/server/wsgi_apache.h b/src/server/wsgi_apache.h
index d03b359..3727f3a 100644
--- a/src/server/wsgi_apache.h
+++ b/src/server/wsgi_apache.h
@@ -71,6 +71,7 @@
#include "apr_version.h"
#include "apr_buckets.h"
#include "apr_date.h"
+#include "mpm_common.h"
#include "apr_optional.h"
diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h
index 2fa8fad..17185ad 100644
--- a/src/server/wsgi_version.h
+++ b/src/server/wsgi_version.h
@@ -25,8 +25,8 @@
#define MOD_WSGI_MAJORVERSION_NUMBER 4
#define MOD_WSGI_MINORVERSION_NUMBER 1
-#define MOD_WSGI_MICROVERSION_NUMBER 0
-#define MOD_WSGI_VERSION_STRING "4.1.1"
+#define MOD_WSGI_MICROVERSION_NUMBER 2
+#define MOD_WSGI_VERSION_STRING "4.1.2"
/* ------------------------------------------------------------------------- */