Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: freeze-exception
Please unblock package mod-wsgi. It's a new upstream release with some bug fixes backported from (unreleased) 4.0 branch (changelog is available here¹). There are also some fixes in packaging (see debian/changelog) including new binary package that will let users choose Python 3 more easily (and is part of "separate Python and Python 3" and "increase Python 3 support in Squeeze" goals). unblock mod-wsgi/3.3-1 [¹] http://code.google.com/p/modwsgi/wiki/ChangesInVersion0303 -- Do you like the idea of time-based freezes? Mention it in your signature in all mails to debian-rele...@l.d.o to encourage Release Team!
diff -Nru mod-wsgi-3.2/debian/changelog mod-wsgi-3.3/debian/changelog --- mod-wsgi-3.2/debian/changelog 2010-08-25 21:54:49.000000000 +0200 +++ mod-wsgi-3.3/debian/changelog 2010-08-25 21:54:50.000000000 +0200 @@ -1,3 +1,22 @@ +mod-wsgi (3.3-1) unstable; urgency=low + + [ Sameer Rahmani ] + * watch file fixed. + + [ Bernd Zeimetz ] + * Ensure that the mod-wsgi symlink is updated to the current default Python + version while installing/upgrading the package. This is only necessary + in rare cases (when the default Python version was updated after the last + rebuild of mod-wsgi), but it needs to be handled properly. + + [ Piotr Ożarowski ] + * New upstream release + * Move Python 3.X extension to new libapache2-mod-wsgi-py3 binary package + * Provide httpd-wsgi (see #588497) + * Bump Standards-Version to 3.9.1 (no changes needed) + + -- Piotr Ożarowski <pi...@debian.org> Wed, 18 Aug 2010 23:40:10 +0200 + mod-wsgi (3.2-2) unstable; urgency=low * mod-wsgi needs to depend on libpython for Python > 2.5. diff -Nru mod-wsgi-3.2/debian/control mod-wsgi-3.3/debian/control --- mod-wsgi-3.2/debian/control 2010-08-25 21:54:49.000000000 +0200 +++ mod-wsgi-3.3/debian/control 2010-08-25 21:54:50.000000000 +0200 @@ -5,7 +5,7 @@ Uploaders: Bernd Zeimetz <b...@debian.org>, Piotr Ożarowski <pi...@debian.org> Build-Depends: debhelper (>= 5), python-all-dev, python3-all-dev, apache2-threaded-dev Homepage: http://www.modwsgi.org/ -Standards-Version: 3.8.4 +Standards-Version: 3.9.1 Vcs-Svn: svn://svn.debian.org/python-modules/packages/mod-wsgi/trunk/ Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/mod-wsgi/trunk/ @@ -13,9 +13,27 @@ Architecture: any Depends: apache2, apache2.2-common, ${shlibs:Depends}, ${misc:Depends}, ${python:Depends} Suggests: apache2-mpm-worker | apache2-mpm-event +Provides: httpd-wsgi Description: Python WSGI adapter module for Apache The mod_wsgi adapter is an Apache module that provides a WSGI (Web Server Gateway Interface, a standard interface between web server software and web applications written in Python) compliant interface for hosting Python based web applications within Apache. The adapter provides significantly better performance than using existing WSGI adapters for mod_python or CGI. + . + This package provides module for Python 2.X. + +Package: libapache2-mod-wsgi-py3 +Architecture: any +Depends: apache2, apache2.2-common, ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends} +Suggests: apache2-mpm-worker | apache2-mpm-event +Conflicts: libapache2-mod-wsgi +Provides: httpd-wsgi +Description: Python 3 WSGI adapter module for Apache + The mod_wsgi adapter is an Apache module that provides a WSGI (Web Server + Gateway Interface, a standard interface between web server software and + web applications written in Python) compliant interface for hosting Python + based web applications within Apache. The adapter provides significantly + better performance than using existing WSGI adapters for mod_python or CGI. + . + This package provides module for Python 3.X. diff -Nru mod-wsgi-3.2/debian/copyright mod-wsgi-3.3/debian/copyright --- mod-wsgi-3.2/debian/copyright 2010-08-25 21:54:49.000000000 +0200 +++ mod-wsgi-3.3/debian/copyright 2010-08-25 21:54:50.000000000 +0200 @@ -9,7 +9,7 @@ Copyright: - Copyright 2007-2009 GRAHAM DUMPLETON + Copyright 2007-2010 GRAHAM DUMPLETON License: @@ -28,5 +28,5 @@ On Debian systems the full text of the Apache License, Version 2, can be found in `/usr/share/common-licenses/Apache-2.0'. -The Debian packaging is © 2007-2009, Bernd Zeimetz <be...@bzed.de> and +The Debian packaging is © 2007-2010, Bernd Zeimetz <be...@bzed.de> and is licensed under the Apache License, Version 2.0, see below. diff -Nru mod-wsgi-3.2/debian/libapache2-mod-wsgi.postinst mod-wsgi-3.3/debian/libapache2-mod-wsgi.postinst --- mod-wsgi-3.2/debian/libapache2-mod-wsgi.postinst 2010-08-25 21:54:49.000000000 +0200 +++ mod-wsgi-3.3/debian/libapache2-mod-wsgi.postinst 2010-08-25 21:54:50.000000000 +0200 @@ -12,13 +12,23 @@ fi } +update_symlink() { + wsgi_py=`readlink /usr/lib/apache2/modules/mod_wsgi.so | sed 's,.*-,,'` + py_default=`dpkg -s python | grep '^Version' | sed 's,Version: \([^.]*.[^.]*\).*,\1,'` + if [ ! "${wsgi_py}" = "${py_default}" ]; then + ln -sf mod_wsgi.so-${py_default} /usr/lib/apache2/modules/mod_wsgi.so + fi +} + if [ -z "$2" ]; then + update_symlink if [ -e /etc/apache2/apache2.conf ]; then a2enmod wsgi >/dev/null || true apache_force_reload fi else #we're upgrading + update_symlink if [ -e /etc/apache2/mods-enabled/wsgi.load ]; then apache_force_reload fi diff -Nru mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.docs mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.docs --- mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.docs 1970-01-01 01:00:00.000000000 +0100 +++ mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.docs 2010-08-25 21:54:50.000000000 +0200 @@ -0,0 +1 @@ +README diff -Nru mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.install mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.install --- mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.install 1970-01-01 01:00:00.000000000 +0100 +++ mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.install 2010-08-25 21:54:50.000000000 +0200 @@ -0,0 +1,2 @@ +debian/wsgi.load etc/apache2/mods-available +debian/wsgi.conf etc/apache2/mods-available diff -Nru mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.postinst mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.postinst --- mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.postinst 1970-01-01 01:00:00.000000000 +0100 +++ mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.postinst 2010-08-25 21:54:50.000000000 +0200 @@ -0,0 +1,39 @@ +#!/bin/sh + +set -e + +apache_force_reload() { + if apache2ctl configtest 2>/dev/null; then + #invoke-rc.d apache2 force-reload || true + # use "restart" as a workaround for bug #558608 + invoke-rc.d apache2 restart || true + else + echo "Your apache2 configuration is broken, please fix it and restart apache2 manually." + fi +} + +update_symlink() { + wsgi_py=`readlink /usr/lib/apache2/modules/mod_wsgi.so | sed 's,.*-,,'` + py3_default=`dpkg -s python3 | grep '^Version' | sed 's,Version: \([^.]*.[^.]*\).*,\1,'` + if [ ! "${wsgi_py}" = "${py3_default}" ]; then + ln -sf mod_wsgi.so-${py3_default} /usr/lib/apache2/modules/mod_wsgi.so + fi +} + +if [ -z "$2" ]; then + update_symlink + if [ -e /etc/apache2/apache2.conf ]; then + a2enmod wsgi >/dev/null || true + apache_force_reload + fi +else + #we're upgrading + update_symlink + if [ -e /etc/apache2/mods-enabled/wsgi.load ]; then + apache_force_reload + fi +fi + +#DEBHELPER# + +exit 0 diff -Nru mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.prerm mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.prerm --- mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.prerm 1970-01-01 01:00:00.000000000 +0100 +++ mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.prerm 2010-08-25 21:54:50.000000000 +0200 @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then + a2dismod wsgi || true +fi + +#DEBHELPER# + +exit 0 diff -Nru mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.rtupdate mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.rtupdate --- mod-wsgi-3.2/debian/libapache2-mod-wsgi-py3.rtupdate 1970-01-01 01:00:00.000000000 +0100 +++ mod-wsgi-3.3/debian/libapache2-mod-wsgi-py3.rtupdate 2010-08-25 21:54:50.000000000 +0200 @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +if [ "$1" = rtupdate ]; then + new_version=`echo ${3} | sed 's,^python,,'` + ln -sf mod_wsgi.so-${new_version} /usr/lib/apache2/modules/mod_wsgi.so +fi diff -Nru mod-wsgi-3.2/debian/rules mod-wsgi-3.3/debian/rules --- mod-wsgi-3.2/debian/rules 2010-08-25 21:54:49.000000000 +0200 +++ mod-wsgi-3.3/debian/rules 2010-08-25 21:54:50.000000000 +0200 @@ -5,14 +5,16 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 - APXS2=/usr/bin/apxs2 PYVERS=$(shell pyversions -vs) -# add Python 3.X versions: -PYVERS += $(shell dpkg-query -W -f='$${Depends}' python3-all-dev | grep -o 'python3.[0-9]-dev' | grep -o '3.[0-9]') PYDEFAULT=$(shell pyversions -dv) PYMIN=$(shell echo $(PYVERS) | awk '{print $$1}') PYMAX=$(shell echo $(PYVERS) | LANG=C awk '{print $$NF+0.1}') +PY3VERS=$(shell py3versions -vs) +PY3DEFAULT=$(shell py3versions -dv) +PY3MIN=$(shell echo $(PY3VERS) | awk '{print $$1}') +PY3MAX=$(shell echo $(PY3VERS) | LANG=C awk '{print $$NF+0.1}') +pkgdir = $(CURDIR)/debian/$(PACKAGE)$(if $(patsubst 3.%,,$(1)),,-py3) build-%/config.status: dh_testdir @@ -26,7 +28,7 @@ $(MAKE) -C build-$* touch $@ -build: $(PYVERS:%=build-%/build-stamp) +build: $(PYVERS:%=build-%/build-stamp) $(PY3VERS:%=build-%/build-stamp) clean: dh_testdir @@ -41,11 +43,11 @@ dh_installdirs install-%: build-%/build-stamp - $(MAKE) -C build-$* DESTDIR=$(CURDIR)/debian/$(PACKAGE) install - mv $(CURDIR)/debian/$(PACKAGE)/usr/lib/apache2/modules/mod_wsgi.so \ - $(CURDIR)/debian/$(PACKAGE)/usr/lib/apache2/modules/mod_wsgi.so-$* + $(MAKE) -C build-$* DESTDIR=$(call pkgdir,$*) install + mv $(call pkgdir,$*)/usr/lib/apache2/modules/mod_wsgi.so \ + $(call pkgdir,$*)/usr/lib/apache2/modules/mod_wsgi.so-$* -install: build install-clean $(PYVERS:%=install-%) +install: build install-clean $(PYVERS:%=install-%) $(PY3VERS:%=install-%) # Build architecture-independent files here. binary-indep: build install @@ -58,9 +60,12 @@ dh_installdocs dh_install install -d -m 755 debian/$(PACKAGE)/usr/share/python/runtime.d - install -m 755 debian/*.rtupdate debian/$(PACKAGE)/usr/share/python/runtime.d/ + install -d -m 755 debian/$(PACKAGE)-py3/usr/share/python3/runtime.d + install -m 755 debian/$(PACKAGE).rtupdate debian/$(PACKAGE)/usr/share/python/runtime.d/ + install -m 755 debian/$(PACKAGE)-py3.rtupdate debian/$(PACKAGE)-py3/usr/share/python3/runtime.d/ dh_installman - dh_link usr/lib/apache2/modules/mod_wsgi.so-$(PYDEFAULT) usr/lib/apache2/modules/mod_wsgi.so + dh_link -p $(PACKAGE) /usr/lib/apache2/modules/mod_wsgi.so-$(PYDEFAULT) usr/lib/apache2/modules/mod_wsgi.so + dh_link -p $(PACKAGE)-py3 /usr/lib/apache2/modules/mod_wsgi.so-$(PY3DEFAULT) usr/lib/apache2/modules/mod_wsgi.so dh_strip dh_compress dh_fixperms @@ -72,6 +77,8 @@ # Generate dependencies manually as there are no public modules echo 'python:Depends=python (>= $(PYMIN)), python (<< $(PYMAX))' \ >> $(CURDIR)/debian/$(PACKAGE).substvars + echo 'python3:Depends=python3 (>= $(PY3MIN)), python3 (<< $(PY3MAX))' \ + >> $(CURDIR)/debian/$(PACKAGE)-py3.substvars dh_gencontrol dh_md5sums dh_builddeb diff -Nru mod-wsgi-3.2/debian/watch mod-wsgi-3.3/debian/watch --- mod-wsgi-3.2/debian/watch 2010-08-25 21:54:49.000000000 +0200 +++ mod-wsgi-3.3/debian/watch 2010-08-25 21:54:50.000000000 +0200 @@ -1,4 +1,5 @@ version=3 - -opts="filenamemangle=s/.*\/mod_wsgi/mod-wsgi/,uversionmangle=s/([0-9.]*)([^0-9.].*)/$1~$2/" \ -http://code.google.com/p/modwsgi/downloads/list http://modwsgi.googlecode.com/files/mod_wsgi-([0-9.]*)\.tar\.gz +opts=\ +downloadurlmangle=s|.*[?]name=(.*?)&.*|http://modwsgi.googlecode.com/files/$1|,\ +filenamemangle=s|[^/]+[?]name=(.*?)&.*|$1| \ +http://code.google.com/p/modwsgi/downloads/detail[?]name=mod_wsgi-([0-9.]+).tar.gz&.* diff -Nru mod-wsgi-3.2/mod_wsgi.c mod-wsgi-3.3/mod_wsgi.c --- mod-wsgi-3.2/mod_wsgi.c 2010-03-09 10:48:50.000000000 +0100 +++ mod-wsgi-3.3/mod_wsgi.c 2010-07-26 05:58:37.000000000 +0200 @@ -1,7 +1,7 @@ /* vim: set sw=4 expandtab : */ /* - * Copyright 2007-2009 GRAHAM DUMPLETON + * Copyright 2007-2010 GRAHAM DUMPLETON * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -372,8 +372,8 @@ /* Version and module information. */ #define MOD_WSGI_MAJORVERSION_NUMBER 3 -#define MOD_WSGI_MINORVERSION_NUMBER 2 -#define MOD_WSGI_VERSION_STRING "3.2" +#define MOD_WSGI_MINORVERSION_NUMBER 3 +#define MOD_WSGI_VERSION_STRING "3.3" #if AP_SERVER_MAJORVERSION_NUMBER < 2 module MODULE_VAR_EXPORT wsgi_module; @@ -1601,6 +1601,17 @@ return Py_None; } +static PyObject *Log_isatty(LogObject *self, PyObject *args) +{ + PyObject *result = NULL; + + if (!PyArg_ParseTuple(args, ":isatty")) + return NULL; + + Py_INCREF(Py_False); + return Py_False; +} + static void Log_queue(LogObject *self, const char *msg, int len) { const char *p = NULL; @@ -1844,6 +1855,7 @@ static PyMethodDef Log_methods[] = { { "flush", (PyCFunction)Log_flush, METH_VARARGS, 0 }, { "close", (PyCFunction)Log_close, METH_VARARGS, 0 }, + { "isatty", (PyCFunction)Log_isatty, METH_VARARGS, 0 }, { "write", (PyCFunction)Log_write, METH_VARARGS, 0 }, { "writelines", (PyCFunction)Log_writelines, METH_VARARGS, 0 }, #if PY_MAJOR_VERSION >= 3 @@ -3031,22 +3043,22 @@ if (self->headers) { /* - * Apache prior to Apache 2.2.8 has a bug in it - * whereby it doesn't force '100 Continue' - * response before responding with headers if no - * read. So, force a zero length read before - * sending the headers if haven't yet attempted - * to read anything. This will ensure that if no - * request content has been read that any '100 - * Continue' response will be flushed and sent - * back to the client if client was expecting - * one. Only want to do this for 2xx and 3xx - * status values. Note that even though Apple - * supplied version of Apache on MacOS X Leopard - * is newer than version 2.2.8, the header file - * has never been patched when they make updates - * and so anything compiled against it thinks it - * is older. + * Apache prior to Apache 2.2.8 has a bug in it + * whereby it doesn't force '100 Continue' + * response before responding with headers if no + * read. So, force a zero length read before + * sending the headers if haven't yet attempted + * to read anything. This will ensure that if no + * request content has been read that any '100 + * Continue' response will be flushed and sent + * back to the client if client was expecting + * one. Only want to do this for 2xx and 3xx + * status values. Note that even though Apple + * supplied version of Apache on MacOS X Leopard + * is newer than version 2.2.8, the header file + * has never been patched when they make updates + * and so anything compiled against it thinks it + * is older. */ #if (AP_SERVER_MAJORVERSION_NUMBER == 1) || \ @@ -5648,6 +5660,26 @@ module = PyImport_ImportModule("atexit"); Py_XDECREF(module); + /* + * In Python 2.6.5 and Python 3.1.2 the shutdown of + * threading was moved back into Py_Finalize() for the main + * Python interpreter. Because we shutting down threading + * ourselves, the second call results in errors being logged + * when Py_Finalize() is called and the shutdown function + * called a second time. The errors don't indicate any real + * problem and the threading module ignores them anyway. + * Whether we are using Python with this changed behaviour + * can only be checked by looking at run time version. + * Rather than try and add a dynamic check, create a fake + * 'dummy_threading' module as the presence of that shuts up + * the messages. It doesn't matter that the rest of the + * shutdown function still runs as everything is already + * stopped so doesn't do anything. + */ + + if (!PyImport_AddModule("dummy_threading")) + PyErr_Clear(); + Py_Finalize(); wsgi_python_initialized = 0; @@ -5768,7 +5800,7 @@ } #endif - /* + /* * Work around bug in Python 3.1 where it will crash * when used in non console application on Windows if * stdin/stdout have been initialised and aren't null. @@ -5944,9 +5976,9 @@ PyGILState_Ensure(); /* - * When simplified GIL state API is used, the thread - * local data only persists for the extent of the top - * level matching ensure/release calls. We want to + * When simplified GIL state API is used, the thread + * local data only persists for the extent of the top + * level matching ensure/release calls. We want to * extend lifetime of the thread local data beyond * that, retaining it for all requests within the one * thread for the life of the process. To do that we @@ -6052,25 +6084,25 @@ #if defined(WIN32) && defined(APR_HAS_UNICODE_FS) if (wsgi_utf8_to_unicode_path(wfilename, sizeof(wfilename) / - sizeof(apr_wchar_t), filename)) { + sizeof(apr_wchar_t), filename)) { - Py_BEGIN_ALLOW_THREADS - if (r) { - ap_log_rerror(APLOG_MARK, WSGI_LOG_ERR(0), r, - "mod_wsgi (pid=%d, process='%s', " - "application='%s'): Failed to convert '%s' " - "to UCS2 filename.", getpid(), - process_group, application_group, filename); - } - else { - ap_log_error(APLOG_MARK, WSGI_LOG_ERR(0), wsgi_server, - "mod_wsgi (pid=%d, process='%s', " - "application='%s'): Failed to convert '%s' " - "to UCS2 filename.", getpid(), - process_group, application_group, filename); - } - Py_END_ALLOW_THREADS - return NULL; + Py_BEGIN_ALLOW_THREADS + if (r) { + ap_log_rerror(APLOG_MARK, WSGI_LOG_ERR(0), r, + "mod_wsgi (pid=%d, process='%s', " + "application='%s'): Failed to convert '%s' " + "to UCS2 filename.", getpid(), + process_group, application_group, filename); + } + else { + ap_log_error(APLOG_MARK, WSGI_LOG_ERR(0), wsgi_server, + "mod_wsgi (pid=%d, process='%s', " + "application='%s'): Failed to convert '%s' " + "to UCS2 filename.", getpid(), + process_group, application_group, filename); + } + Py_END_ALLOW_THREADS + return NULL; } fp = _wfopen(wfilename, "r"); @@ -9988,8 +10020,28 @@ return -1; } + /* + * Set the ownership of the UNIX listener socket. This would + * normally be the Apache user that the Apache server child + * processes run as, as they are the only processes that + * would connect to the sockets. In the case of ITK MPM, + * having them owned by Apache user is useless as at the + * time the request is to be proxied, the Apache server + * child process will have uid corresponding to the user + * whose request they are handling. For ITK, thus set the + * ownership to be the same as the daemon processes. This is + * still restrictive, in that can only connect to daemon + * process group running under same user, but most of the + * time that is what you would want anyway when using ITK + * MPM. + */ + if (!geteuid()) { +#if defined(MPM_ITK) + if (chown(process->socket, process->uid, -1) < 0) { +#else if (chown(process->socket, ap_unixd_config.user_id, -1) < 0) { +#endif ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server, "mod_wsgi (pid=%d): Couldn't change owner of unix " "domain socket '%s'.", getpid(), @@ -10157,7 +10209,7 @@ } else { /* - * Flag that thread should be woken up and then + * Flag that thread should be woken up and then * signal it via the condition variable. */ @@ -10469,7 +10521,7 @@ apr_thread_mutex_unlock(wsgi_shutdown_lock); while (1) { - apr_sleep(apr_time_from_sec(1.0)); + apr_sleep(apr_time_from_sec(1)); PyEval_AcquireLock(); PyEval_ReleaseLock(); @@ -10487,6 +10539,8 @@ { WSGIDaemonProcess *daemon = data; + int restart = 0; + if (wsgi_server_config->verbose_debugging) { ap_log_error(APLOG_MARK, WSGI_LOG_DEBUG(0), wsgi_server, "mod_wsgi (pid=%d): Enable monitor thread in " @@ -10506,8 +10560,6 @@ apr_time_t deadlock_time; apr_time_t inactivity_time; - int restart = 0; - apr_interval_time_t period = 0; now = apr_time_now(); @@ -10517,37 +10569,44 @@ inactivity_time = wsgi_inactivity_shutdown_time; apr_thread_mutex_unlock(wsgi_shutdown_lock); - if (wsgi_deadlock_timeout && deadlock_time) { - if (deadlock_time <= now) { - ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0), wsgi_server, - "mod_wsgi (pid=%d): Daemon process deadlock " - "timer expired, stopping process '%s'.", - getpid(), daemon->group->name); - - restart = 1; + if (!restart && wsgi_deadlock_timeout) { + if (deadlock_time) { + if (deadlock_time <= now) { + ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0), wsgi_server, + "mod_wsgi (pid=%d): Daemon process deadlock " + "timer expired, stopping process '%s'.", + getpid(), daemon->group->name); - period = wsgi_deadlock_timeout; + restart = 1; + } + else { + period = deadlock_time - now; + } } else { - period = deadlock_time - now; + period = wsgi_deadlock_timeout; } } - if (!restart && wsgi_inactivity_timeout && inactivity_time) { - if (inactivity_time <= now) { - ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0), wsgi_server, - "mod_wsgi (pid=%d): Daemon process inactivity " - "timer expired, stopping process '%s'.", - getpid(), daemon->group->name); - - restart = 1; + if (!restart && wsgi_inactivity_timeout) { + if (inactivity_time) { + if (inactivity_time <= now) { + ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0), wsgi_server, + "mod_wsgi (pid=%d): Daemon process " + "inactivity timer expired, stopping " + "process '%s'.", getpid(), + daemon->group->name); - if (!period || (wsgi_inactivity_timeout < period)) - period = wsgi_inactivity_timeout; + restart = 1; + } + else { + if (!period || ((inactivity_time - now) < period)) + period = inactivity_time - now; + } } else { - if (!period || ((inactivity_time - now) < period)) - period = inactivity_time - now; + if (!period || (wsgi_inactivity_timeout < period)) + period = wsgi_inactivity_timeout; } } @@ -10556,8 +10615,8 @@ kill(getpid(), SIGINT); } - if (period <= 0) - period = apr_time_from_sec(1.0); + if (restart || period <= 0) + period = apr_time_from_sec(1); apr_sleep(period); } @@ -11110,32 +11169,44 @@ } /* - * Reassociate stderr output with error log from the - * virtual host the daemon is associated with. Close - * the virtual host error log and point it at stderr - * log instead. Do the latter so don't get two - * references to same open file. Just in case - * anything still accesses error log of main server, - * map main server error log to that of the virtual - * host. Note that cant do this if errors are being - * redirected to syslog, as indicated by virtual - * host error log being a null pointer. In that case - * just leave everything as it was. Also can't remap - * the error log for main server if it was being - * redirected to syslog but virtual host wasn't. + * Reassociate stderr output with error log from the + * virtual host the daemon is associated with. Close + * the virtual host error log and point it at stderr + * log instead. Do the latter so don't get two + * references to same open file. Just in case + * anything still accesses error log of main server, + * map main server error log to that of the virtual + * host. Note that cant do this if errors are being + * redirected to syslog, as indicated by virtual + * host error log being a null pointer. In that case + * just leave everything as it was. Also can't remap + * the error log for main server if it was being + * redirected to syslog but virtual host wasn't. */ if (daemon->group->server->error_log && daemon->group->server->error_log != wsgi_server->error_log) { + + apr_file_t *oldfile = NULL; + apr_file_open_stderr(&errfile, wsgi_server->process->pool); apr_file_dup2(errfile, daemon->group->server->error_log, wsgi_server->process->pool); - apr_file_close(daemon->group->server->error_log); - daemon->group->server->error_log = errfile; + oldfile = daemon->group->server->error_log; + + server = wsgi_server; + + while (server != NULL) { + if (server->error_log == oldfile) + server->error_log = errfile; + server = server->next; + } + + apr_file_close(oldfile); if (wsgi_server->error_log) - wsgi_server->error_log = daemon->group->server->error_log; + wsgi_server->error_log = errfile; } } @@ -11150,10 +11221,8 @@ if (wsgi_server_config->verbose_debugging) { ap_log_error(APLOG_MARK, WSGI_LOG_DEBUG(0), wsgi_server, "mod_wsgi (pid=%d): Process '%s' logging to " - "'%s' with log level %d.", getpid(), - daemon->group->name, - daemon->group->server->server_hostname, - daemon->group->server->loglevel); + "'%s'.", getpid(), daemon->group->name, + daemon->group->server->server_hostname); } wsgi_server = daemon->group->server; @@ -11162,9 +11231,8 @@ if (wsgi_server_config->verbose_debugging) { ap_log_error(APLOG_MARK, WSGI_LOG_DEBUG(0), wsgi_server, "mod_wsgi (pid=%d): Process '%s' forced to log " - "to '%s' with log level %d.", getpid(), - daemon->group->name, wsgi_server->server_hostname, - wsgi_server->loglevel); + "to '%s'.", getpid(), daemon->group->name, + wsgi_server->server_hostname); } } @@ -11434,7 +11502,7 @@ struct sockaddr_un addr; int retries = 0; - apr_interval_time_t timer = apr_time_from_sec(0.1); + apr_interval_time_t timer = 0; memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; @@ -11461,11 +11529,19 @@ close(daemon->fd); - /* Increase wait time up to maximum of 2 seconds. */ + /* + * Progressively increase time we wait between + * connection attempts. Start at 0.1 second and + * double each time but apply ceiling at 2.0 + * seconds. + */ + + if (!timer) + timer = apr_time_make(0, 100000); apr_sleep(timer); - if (timer < apr_time_from_sec(2)) - timer *= 2; + + timer = (2 * timer) % apr_time_make(2, 0); } else { ap_log_rerror(APLOG_MARK, WSGI_LOG_ERR(errno), r, @@ -14595,7 +14671,7 @@ if (apr_table_elts(grpstatus)->nelts == 0) { ap_log_rerror(APLOG_MARK, WSGI_LOG_ERR(0), r, "mod_wsgi (pid=%d): " - "Authorization of user '%s' to access '%s' failed. ", + "Authorization of user '%s' to access '%s' failed. " "User is not a member of any groups.", getpid(), r->user, r->uri); return AUTHZ_DENIED; diff -Nru mod-wsgi-3.2/README mod-wsgi-3.3/README --- mod-wsgi-3.2/README 2009-06-22 08:53:43.000000000 +0200 +++ mod-wsgi-3.3/README 2010-07-26 05:31:47.000000000 +0200 @@ -2,7 +2,7 @@ Welcome to MOD_WSGI =================== -Copyright 2007-2009 GRAHAM DUMPLETON +Copyright 2007-2010 GRAHAM DUMPLETON The mod_wsgi adapter is an Apache module that provides a WSGI compliant interface for hosting Python based web applications within Apache. The @@ -44,6 +44,28 @@ Apache Licence, Version 2.0. See the "LICENCE" file for more information. +Donations +========= + +A significant amount of time and effort has gone into producing this +software, the associated documentation on the web site and in providing +support to users. So, although you are free to download it and do with it +as you wish, it is not free from cost. + +If you are using mod_wsgi, please consider making a donation. By giving a +donation you help to ensure that mod_wsgi will continue to be developed and +the documentation further improved. + +For details on how you can contribute back to mod_wsgi, see: + + http://code.google.com/p/modwsgi/wiki/HowToContributeBack + +If you are philosophically against the idea of contributing back to Open +Source projects in a monetary way and find it obnoxious that any Open +Source project would solicit donations, then it is suggested that you use +one of the alternatives to mod_wsgi such as CGI. + + Documentation =============
signature.asc
Description: Digital signature