[Zodb-checkins] SVN: ZODB/branches/3.8/ Fixed bug that can cause the asyncore client loop to fail.

Jim Fulton jim at zope.com
Sat Nov 17 14:53:18 EST 2007


Log message for revision 81901:
  Fixed bug that can cause the asyncore client loop to fail.
  

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-11-17 19:26:10 UTC (rev 81900)
+++ ZODB/branches/3.8/NEWS.txt	2007-11-17 19:53:18 UTC (rev 81901)
@@ -33,9 +33,10 @@
 ZEO
 ---
 
-- (3.8.0b4) Fixed a serious bug that could cause client I/O to stop
+- (3.8.0b4, 3.8.0b5) 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".
+  (In b4, the bug was only partially fixed.)
 
 - (3.8a1) ZEO's strategoes for avoiding client cache verification were
   improved in the case that servers are restarted.  Before, if

Modified: ZODB/branches/3.8/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/branches/3.8/src/ZEO/zrpc/connection.py	2007-11-17 19:26:10 UTC (rev 81900)
+++ ZODB/branches/3.8/src/ZEO/zrpc/connection.py	2007-11-17 19:53:18 UTC (rev 81901)
@@ -82,7 +82,10 @@
                     continue
 
             if not (r or w or e):
-                for obj in client_map.itervalues():
+                # The line intentionally doesn't use iterators. Other
+                # threads can close dispatchers, causeing the socket
+                # map to shrink.
+                for obj in client_map.values():
                     if isinstance(obj, Connection):
                         # Send a heartbeat message as a reply to a
                         # non-existent message id.



More information about the Zodb-checkins mailing list