[Zodb-checkins] CVS: ZODB3/ZEO/tests - forker.py:1.19

Guido van Rossum guido@python.org
Fri, 13 Sep 2002 15:35:03 -0400


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv31997

Modified Files:
	forker.py 
Log Message:
I think I've seen a child process that didn't exec another program
service asyncore events intended for a ClientStorage created in the
parent.  That can't be intended.  The best way I can see to avoid this
is simply to clear asyncore's socket_map after the fork.


=== ZODB3/ZEO/tests/forker.py 1.18 => 1.19 ===
--- ZODB3/ZEO/tests/forker.py:1.18	Fri Sep 13 01:18:18 2002
+++ ZODB3/ZEO/tests/forker.py	Fri Sep 13 15:35:02 2002
@@ -108,8 +108,9 @@
         rd, wr = os.pipe()
         pid = os.fork()
         if pid == 0:
+            asyncore.socket_map.clear() # Don't service the parent's sockets
             import ZEO.zrpc.log
-            reload(ZEO.zrpc.log)
+            reload(ZEO.zrpc.log) # Don't share the logging file object
             try:
                 if PROFILE:
                     p = hotshot.Profile("stats.s.%d" % os.getpid())