From 66ec492f1509594e7eeffd3c38a9251102f5716b Mon Sep 17 00:00:00 2001 From: Luke Macken Date: Nov 04 2007 18:52:24 +0000 Subject: - Apply backported fix from http://www.cherrypy.org/changeset/1766 to improve CherryPy's SIGSTOP/SIGCONT handling (Bug #364911). Thanks to Nils Philippsen for the patch. --- diff --git a/python-cherrypy-2.2.1-EINTR.patch b/python-cherrypy-2.2.1-EINTR.patch new file mode 100644 index 0000000..4f5b017 --- /dev/null +++ b/python-cherrypy-2.2.1-EINTR.patch @@ -0,0 +1,26 @@ +diff -up cherrypy/_cpwsgiserver.py.EINTR cherrypy/_cpwsgiserver.py +--- cherrypy/_cpwsgiserver.py.EINTR 2006-04-25 03:37:45.000000000 +0200 ++++ cherrypy/_cpwsgiserver.py 2007-11-03 01:14:20.000000000 +0100 +@@ -332,6 +332,22 @@ class CherryPyWSGIServer(object): + # notice keyboard interrupts on Win32, which don't interrupt + # accept() by default + return ++ except socket.error, x: ++ if hasattr(errno, "EINTR") and x.args[0] == errno.EINTR: ++ # I *think* this is right. EINTR should occur when a signal ++ # is received during the accept() call; all docs say retry ++ # the call, and I *think* I'm reading it right that Python ++ # will then go ahead and poll for and handle the signal ++ # elsewhere. See http://www.cherrypy.org/ticket/707. ++ return ++ msg = x.args[1] ++ if msg in ("Bad file descriptor", "Socket operation on non-socket"): ++ # Our socket was closed. ++ return ++ if msg == "Resource temporarily unavailable": ++ # Just try again. See http://www.cherrypy.org/ticket/479. ++ return ++ raise + + def stop(self): + """Gracefully shutdown a server that is serving forever.""" diff --git a/python-cherrypy.spec b/python-cherrypy.spec index 2685449..eb86079 100644 --- a/python-cherrypy.spec +++ b/python-cherrypy.spec @@ -2,15 +2,16 @@ Name: python-cherrypy Version: 2.2.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A pythonic, object-oriented web development framework Group: Development/Libraries License: BSD URL: http://www.cherrypy.org/ Source0: http://dl.sf.net/cherrypy/CherryPy-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Patch0: python-cherrypy-tutorial-doc.patch -Patch1: python-cherrypy-regression-test.patch +Patch0: %{name}-tutorial-doc.patch +Patch1: %{name}-regression-test.patch +Patch2: %{name}-%{version}-EINTR.patch BuildArch: noarch @@ -25,6 +26,7 @@ results in smaller source code developed in less time. %setup -q -n CherryPy-%{version} %patch0 %patch1 +%patch2 %build @@ -55,6 +57,11 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/cherrypy/filters/*.py* %changelog +* Sat Nov 3 2007 Luke Macken 2.2.1-7 +- Apply backported fix from http://www.cherrypy.org/changeset/1766 + to improve CherryPy's SIGSTOP/SIGCONT handling (Bug #364911). + Thanks to Nils Philippsen for the patch. + * Mon Feb 19 2007 Luke Macken 2.2.1-6 - Disable regression tests until we can figure out why they are dying in mock.