[Checkins] SVN: zc.ngi/trunk/ Don't add async listeners to socket map until they're fully set up.

Jim Fulton jim at zope.com
Tue Sep 8 14:35:08 EDT 2009


Log message for revision 103655:
  Don't add async listeners to socket map until they're fully set up.
  (This is an issue because the async loop is in a separate thread.)
  

Changed:
  U   zc.ngi/trunk/README.txt
  U   zc.ngi/trunk/src/zc/ngi/async.py

-=-
Modified: zc.ngi/trunk/README.txt
===================================================================
--- zc.ngi/trunk/README.txt	2009-09-08 18:30:26 UTC (rev 103654)
+++ zc.ngi/trunk/README.txt	2009-09-08 18:35:07 UTC (rev 103655)
@@ -17,6 +17,15 @@
 *******
 
 ==================
+1.1.4 (2009-09-??)
+==================
+
+Bug fixed:
+
+- Spurious warnings sometimes occurred due to a race condition in
+  setting up servers.
+
+==================
 1.1.3 (2009-07-30)
 ==================
 

Modified: zc.ngi/trunk/src/zc/ngi/async.py
===================================================================
--- zc.ngi/trunk/src/zc/ngi/async.py	2009-09-08 18:30:26 UTC (rev 103654)
+++ zc.ngi/trunk/src/zc/ngi/async.py	2009-09-08 18:35:07 UTC (rev 103655)
@@ -340,7 +340,9 @@
 
     def add_channel(self, map=None):
         # work around file-dispatcher bug
-        assert (map is None) or (map is _map)
+        if map is None:
+            return
+        assert (map is _map)
         asyncore.dispatcher.add_channel(self, _map)
 
     def handle_error(self):
@@ -370,6 +372,7 @@
         except socket.error:
             self.close()
             raise
+        self.add_channel(_map)
         notify_select()
 
     def handle_accept(self):
@@ -440,6 +443,7 @@
         except socket.error:
             self.close()
             raise
+        self.add_channel(_map)
         notify_select()
 
     def handle_read(self):



More information about the checkins mailing list