[Zodb-checkins] CVS: StandaloneZODB/ZEO/tests - forker.py:1.10.4.4

Jeremy Hylton jeremy@zope.com
Wed, 16 Jan 2002 10:05:27 -0500


Update of /cvs-repository/StandaloneZODB/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv25665/tests

Modified Files:
      Tag: Standby-branch
	forker.py 
Log Message:
Attempt to import ZEO stuff after the fork.

There's crufty logging code that includes os.getpid() in the subsystem
name.  It's very helpful when it's correct, but it's even more
unhelpful when it's wrong.

XXX Need to fix the logging code so that the pid is looked up in a
more useful.  Perhaps just on every call.


=== StandaloneZODB/ZEO/tests/forker.py 1.10.4.3 => 1.10.4.4 ===
 import traceback
 import types
-import ZEO.ClientStorage, ZEO.StorageServer
+import ZEO.ClientStorage
 
 # Change value of PROFILE to enable server-side profiling
 PROFILE = 0
@@ -101,6 +101,8 @@
         rd, wr = os.pipe()
         pid = os.fork()
         if pid == 0:
+            import ZEO.zrpc.log
+            reload(ZEO.zrpc.log)
             try:
                 if PROFILE:
                     p = hotshot.Profile("stats.s.%d" % os.getpid())
@@ -122,8 +124,9 @@
         global server
         os.close(wr)
         ZEOServerExit(rd)
+        import ZEO.StorageServer, ZEO.zrpc.server
         server = ZEO.StorageServer.StorageServer(addr, {'1':storage})
-        asyncore.loop()
+        ZEO.zrpc.server.loop()
         storage.close()
         if isinstance(addr, types.StringType):
             os.unlink(addr)