[Checkins] SVN: ZODB/trunk/src/ Bugs Fixed

Jim Fulton jim at zope.com
Thu Jul 2 16:55:40 EDT 2009


Log message for revision 101410:
  Bugs Fixed
  ----------
  
  - ZEO client threads were unnamed, making it hard to debug thread
    management.
  

Changed:
  U   ZODB/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/ZEO/tests/testZEO.py
  U   ZODB/trunk/src/ZEO/zrpc/connection.py

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2009-07-02 20:39:07 UTC (rev 101409)
+++ ZODB/trunk/src/CHANGES.txt	2009-07-02 20:55:40 UTC (rev 101410)
@@ -2,6 +2,16 @@
  Change History
 ================
 
+3.9.0b2 (2009-07-02)
+====================
+
+Bugs Fixed
+----------
+
+- ZEO client threads were unnamed, making it hard to debug thread
+  management.
+
+
 3.9.0b2 (2009-06-11)
 ====================
 

Modified: ZODB/trunk/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO.py	2009-07-02 20:39:07 UTC (rev 101409)
+++ ZODB/trunk/src/ZEO/tests/testZEO.py	2009-07-02 20:55:40 UTC (rev 101410)
@@ -1174,6 +1174,12 @@
     >>> db.close()
     """
 
+def client_asyncore_thread_has_name():
+    """
+    >>> len([t for t in threading.enumerate()
+    ...      if t.getName() == 'ZEO.zrpc.connection'])
+    1
+    """
 
 slow_test_classes = [
     BlobAdaptedFileStorageTests, BlobWritableCacheTests,

Modified: ZODB/trunk/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/connection.py	2009-07-02 20:39:07 UTC (rev 101409)
+++ ZODB/trunk/src/ZEO/zrpc/connection.py	2009-07-02 20:55:40 UTC (rev 101410)
@@ -47,7 +47,7 @@
     global client_running
     client_running = False
     client_trigger.pull_trigger()
-    client_exit_event.wait()
+    client_exit_event.wait(99)
 
 atexit.register(client_exit)
 
@@ -61,10 +61,10 @@
     client_exit_event.clear()
     global client_running
     client_running = True
-    
+
     while client_running and map:
         try:
-            
+
             # The next two lines intentionally don't use
             # iterators. Other threads can close dispatchers, causeing
             # the socket map to shrink.
@@ -87,7 +87,7 @@
                             continue
                         if [fd for fd in w if fd not in map]:
                             continue
-                        
+
                     raise
                 else:
                     continue
@@ -153,7 +153,7 @@
 
     client_exit_event.set()
 
-client_thread = threading.Thread(target=client_loop)
+client_thread = threading.Thread(target=client_loop, name=__name__)
 client_thread.setDaemon(True)
 client_thread.start()
 #
@@ -344,7 +344,7 @@
     #             restorea, iterator_start, iterator_next,
     #             iterator_record_start, iterator_record_next,
     #             iterator_gc
-    
+
     # Protocol variables:
     # Our preferred protocol.
     current_protocol = "Z309"
@@ -548,7 +548,7 @@
 
     def handle_request(self, msgid, flags, name, args):
         obj = self.obj
-        
+
         if name.startswith('_') or not hasattr(obj, name):
             if obj is None:
                 if __debug__:
@@ -556,7 +556,7 @@
                              % (name, short_repr(args)),
                              level=logging.DEBUG)
                 return
-                
+
             msg = "Invalid method name: %s on %s" % (name, repr(obj))
             raise ZRPCError(msg)
         if __debug__:
@@ -781,7 +781,7 @@
         self.trigger.pull_trigger()
 
 
-        
+
 class ManagedServerConnection(Connection):
     """Server-side Connection subclass."""
 



More information about the Checkins mailing list