[ZCM] [ZC] 739/ 2 Comment "PCGIServer crashes on Solaris, stops responding"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Fri, 20 Dec 2002 10:28:53 -0500


Issue #739 Update (Comment) "PCGIServer crashes on Solaris, stops responding"
 Status Pending, ZServer/bug+solution critical
To followup, visit:
  http://collector.zope.org/Zope/739

==============================================================
= Comment - Entry #2 by peterb on Dec 20, 2002 10:28 am


Uploaded:  "PCGIServer.py.diff"
 - http://collector.zope.org/Zope/739/PCGIServer.py.diff/view
Diff submitted as file 
________________________________________
= Request - Entry #1 by peterb on Dec 20, 2002 10:26 am

After one night's inactivity the first request will often yield the following error and the server will stop responding to incoming requests:

2002-12-20T12:01:59 ERROR(200) ZServer uncaptured python exception, closing channel <ZServer.PCGIServer.PCGIServer listening '/opt/Appload/InstanceHome/var/pcgi.soc' at 0xc9f89c> (exceptions.TypeError:unpack non-sequence [/opt/Appload/InstanceHome/../Zope/ZServer/medusa/asyncore.py|poll|94] [/opt/Appload/InstanceHome/../Zope/ZServer/medusa/asyncore.py|handle_read_event|389] [/opt/Appload/InstanceHome/../Zope/ZServer/PCGIServer.py|handle_accept|319])


The error seems to be triggered by accept() returning None or some such. Looking at FTPServer.py it checks for this condition but PCGIServer does not.

Interestingly Zope 2.4.3 did not have this problem although it does not check if accept() returns None. Zope 2.5.1 has this problem and does not check for None.

Suggested patch:

--- PCGIServer.py       Fri Dec 20 13:56:10 2002
***************
*** 320,325 ****
--- 320,329 ----
          except socket.error:
              self.log_info('Server accept() threw an exception', 'warning')
              return
+         except TypeError:
+             # unpack non-sequence as result of accept
+             # returning None (in case of EWOULDBLOCK)
+             return
          self.channel_class(self, conn, addr)

      def readable(self):



==============================================================