[mod_wsgi] use a NULL c->sbh pointer with httpd 2.4 (possible fix for #867276)
jorton
jorton at fedoraproject.org
Wed Oct 17 08:53:46 UTC 2012
commit 76920be5e5c1de8363df24054fbb6f047cd4e505
Author: Joe Orton <jorton at redhat.com>
Date: Wed Oct 17 09:53:42 2012 +0100
use a NULL c->sbh pointer with httpd 2.4 (possible fix for #867276)
- add logging for unexpected daemon process loss
Resolves: rhbz#867276
mod_wsgi-3.4-connsbh.patch | 16 ++++++++++++++++
mod_wsgi-3.4-procexit.patch | 23 +++++++++++++++++++++++
mod_wsgi.spec | 10 +++++++++-
3 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/mod_wsgi-3.4-connsbh.patch b/mod_wsgi-3.4-connsbh.patch
new file mode 100644
index 0000000..a7c5925
--- /dev/null
+++ b/mod_wsgi-3.4-connsbh.patch
@@ -0,0 +1,16 @@
+--- mod_wsgi-3.4/mod_wsgi.c.connsbh
++++ mod_wsgi-3.4/mod_wsgi.c
+@@ -10600,7 +10600,13 @@ static void wsgi_process_socket(apr_pool
+ * will add their own input/output filters to the chain.
+ */
+
++#if AP_MODULE_MAGIC_AT_LEAST(20110619,0)
++ /* For 2.4 a NULL sbh pointer should work. */
++ sbh = NULL;
++#else
++ /* For 2.2 a dummy sbh pointer is needed. */
+ ap_create_sb_handle(&sbh, p, -1, 0);
++#endif
+
+ c = (conn_rec *)apr_pcalloc(p, sizeof(conn_rec));
+
diff --git a/mod_wsgi-3.4-procexit.patch b/mod_wsgi-3.4-procexit.patch
new file mode 100644
index 0000000..6737f2c
--- /dev/null
+++ b/mod_wsgi-3.4-procexit.patch
@@ -0,0 +1,23 @@
+--- mod_wsgi-3.3/mod_wsgi.c.procexit
++++ mod_wsgi-3.3/mod_wsgi.c
+@@ -9845,6 +9845,20 @@ static void wsgi_manage_process(int reas
+ wsgi_server, "mod_wsgi (pid=%d): "
+ "Process '%s' has died, restarting.",
+ daemon->process.pid, daemon->group->name);
++ if (WIFEXITED(status)) {
++ ap_log_error(APLOG_MARK, WSGI_LOG_DEBUG(0),
++ wsgi_server, "mod_wsgi (pid=%d): "
++ "Process '%s' terminated normally, exit code %d",
++ daemon->process.pid, daemon->group->name,
++ WEXITSTATUS(status));
++ }
++ else if (WIFSIGNALED(status)) {
++ ap_log_error(APLOG_MARK, WSGI_LOG_DEBUG(0),
++ wsgi_server, "mod_wsgi (pid=%d): "
++ "Process '%s' terminated by signal %d",
++ daemon->process.pid, daemon->group->name,
++ WTERMSIG(status));
++ }
+
+ wsgi_start_process(wsgi_parent_pool, daemon);
+ }
diff --git a/mod_wsgi.spec b/mod_wsgi.spec
index 203753e..e58c345 100644
--- a/mod_wsgi.spec
+++ b/mod_wsgi.spec
@@ -6,7 +6,7 @@
Name: mod_wsgi
Version: 3.4
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A WSGI interface for Python web applications in Apache
Group: System Environment/Libraries
@@ -14,6 +14,8 @@ License: ASL 2.0
URL: http://modwsgi.org
Source0: http://modwsgi.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: wsgi.conf
+Patch0: mod_wsgi-3.4-connsbh.patch
+Patch1: mod_wsgi-3.4-procexit.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: httpd-devel
@@ -30,6 +32,8 @@ existing WSGI adapters for mod_python or CGI.
%prep
%setup -q
+%patch0 -p1 -b .connsbh
+%patch1 -p1 -b .procexit
%build
export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}"
@@ -61,6 +65,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Wed Oct 17 2012 Joe Orton <jorton at redhat.com> - 3.4-3
+- use a NULL c->sbh pointer with httpd 2.4 (possible fix for #867276)
+- add logging for unexpected daemon process loss
+
* Wed Oct 17 2012 Matthias Runge <mrunge at redhat.com> - 3.4-2
- also use RPM_LD_FLAGS for build bz. #867137
More information about the scm-commits
mailing list