Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #861 (defect)

Opened 2 months ago

Last modified 2 months ago

Missing socket.error exception catching

Status: assigned

Reported by: olivier.aubert@liris.cnrs.fr Assigned to: fumanchu (accepted)
Priority: normal Milestone: 3.0
Component: wsgiserver Keywords:
Cc:

In wsgiserver.tick, some socket.error exceptions are caught and ignored ("Bad file descriptor", "Socket operation on non-socket", "Resource temporarily unavailable").

When using in the same application gtk and cherrypy, displaying a gtk dialog (such as a fileselector) while cause the server to crash with the "Interrupted system call" exception.

Catching this exception solves the issue :

--- /tmp/__init__.py    2008-09-24 18:13:55.000000000 +0200
+++ /var/lib/python-support/python2.5/cherrypy/wsgiserver/__init__.py   2008-09-24 17:40:30.000000000 +0200
@@ -913,6 +913,8 @@
             if msg == "Resource temporarily unavailable":
                 # Just try again. See http://www.cherrypy.org/ticket/479.
                 return
+            if msg == "Interrupted system call":
+                return
             raise
     
     def _get_interrupt(self):

But considering also #860 (use error code rather than error message), the except clause should rather catch the error code 4.

Change History

09/27/08 15:12:33: Modified by fumanchu

  • status changed from new to assigned.
  • description changed.
  • milestone set to 3.0.

If using a version after [1937], you should just add 4 to wsgiserver.socket_errors_to_ignore. Do you think that needs to be added to the distro? Can you tell me what socket attribute corresponds to '4' on your system? If it's EINTR, then that's already handled via the socket_error_eintr list.

Does this need a backport to 3.0.x?

Hosted by WebFaction

Log in as guest/cpguest to create tickets