[Zope-Checkins] CVS: Zope - z2.py:1.83.2.2.2.1

Toby Dickenson tdickenson@geminidataloggers.com
Thu, 10 Oct 2002 13:28:24 -0400


Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv27621

Modified Files:
      Tag: toby-clean-shutdown-branch
	z2.py 
Log Message:
draft implementation of the clean shutdown proposal. ZMI and signal-based shutdown methods now set a global variable. This global variable causes the main medusa loop to return. We then gradually shut down sockets, in the right order. If any clients are slowly downloading a file then they can cause the shutdown to be delayed by up to 30 seconds, to allow them time to complete. This is true unless the shutdown was triggered by SIGTERM - we need to shutdown fast because the whole machine might be going down, and we can expect a SIGKILL within a few seconds.

=== Zope/z2.py 1.83.2.2 => 1.83.2.2.2.1 ===
--- Zope/z2.py:1.83.2.2	Tue Oct  8 17:18:20 2002
+++ Zope/z2.py	Thu Oct 10 13:27:52 2002
@@ -903,5 +903,8 @@
 
 # Start Medusa, Ye Hass!
 sys.ZServerExitCode=0
-asyncore.loop()
-sys.exit(sys.ZServerExitCode)
+import Lifetime
+Lifetime.loop()
+code = sys.ZServerExitCode
+zLOG.LOG("z2", zLOG.INFO, 'Exiting with code %d' % code )
+sys.exit(code)