[Zodb-checkins] SVN: ZODB/trunk/ Fixed a serious bug that could cause client I/O to stop

Jim Fulton jim at zope.com
Mon Sep 24 18:50:01 EDT 2007


Log message for revision 79950:
  Fixed a serious bug that could cause client I/O to stop
  (hang). This was accomonied by a critical log message along the
  lines of: "RuntimeError: dictionary changed size during iteration".
  

Changed:
  U   ZODB/trunk/NEWS.txt
  U   ZODB/trunk/src/ZEO/zrpc/connection.py

-=-
Modified: ZODB/trunk/NEWS.txt
===================================================================
--- ZODB/trunk/NEWS.txt	2007-09-24 22:47:35 UTC (rev 79949)
+++ ZODB/trunk/NEWS.txt	2007-09-24 22:50:00 UTC (rev 79950)
@@ -18,7 +18,9 @@
 ZEO
 ---
 
-- 
+- (3.9.0a1) Fixed a serious bug that could cause client I/O to stop
+  (hang). This was accomonied by a critical log message along the
+  lines of: "RuntimeError: dictionary changed size during iteration".
 
 Transactions
 ------------

Modified: ZODB/trunk/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/connection.py	2007-09-24 22:47:35 UTC (rev 79949)
+++ ZODB/trunk/src/ZEO/zrpc/connection.py	2007-09-24 22:50:00 UTC (rev 79950)
@@ -53,8 +53,12 @@
     
     while map:
         try:
-            r = e = list(client_map)
-            w = [fd for (fd, obj) in map.iteritems() if obj.writable()]
+            
+            # The next two lines intentionally don't use
+            # iterators. Other threads can close dispatchers, causeing
+            # the socket map to shrink.
+            r = e = client_map.keys()
+            w = [fd for (fd, obj) in map.items() if obj.writable()]
 
             try:
                 r, w, e = select.select(r, w, e, client_timeout)



More information about the Zodb-checkins mailing list