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

Jim Fulton jim at zope.com
Mon Sep 24 19:22:42 EDT 2007


Log message for revision 79962:
  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/branches/3.8/NEWS.txt
  U   ZODB/branches/3.8/src/ZEO/zrpc/connection.py

-=-
Modified: ZODB/branches/3.8/NEWS.txt
===================================================================
--- ZODB/branches/3.8/NEWS.txt	2007-09-24 23:18:41 UTC (rev 79961)
+++ ZODB/branches/3.8/NEWS.txt	2007-09-24 23:22:42 UTC (rev 79962)
@@ -30,6 +30,10 @@
 ZEO
 ---
 
+- (3.8.0b4) 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".
+
 - (3.8a1) ZEO's strategoes for avoiding client cache verification were
   improved in the case that servers are restarted.  Before, if
   transactions were committed after the restart, clients that were up

Modified: ZODB/branches/3.8/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/branches/3.8/src/ZEO/zrpc/connection.py	2007-09-24 23:18:41 UTC (rev 79961)
+++ ZODB/branches/3.8/src/ZEO/zrpc/connection.py	2007-09-24 23:22:42 UTC (rev 79962)
@@ -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