[Zodb-checkins] CVS: ZODB3/ZEO - StorageServer.py:1.74.2.5

Guido van Rossum guido@python.org
Tue, 12 Nov 2002 12:59:56 -0500


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv463

Modified Files:
      Tag: ZODB3-3_1-branch
	StorageServer.py 
Log Message:
Fix for SF tracker item 634121: restart_other() was referencing an
undefined _conn attribute on zeo_storage.  The fix renames this
attribute to connection and sets it in notifyConnected().

*** I can't test this because currently the test suite doesn't
    exercise this code.  SF item 637243 is about that problem. ***


=== ZODB3/ZEO/StorageServer.py 1.74.2.4 => 1.74.2.5 ===
--- ZODB3/ZEO/StorageServer.py:1.74.2.4	Thu Oct 31 15:10:47 2002
+++ ZODB3/ZEO/StorageServer.py	Tue Nov 12 12:59:56 2002
@@ -205,6 +205,7 @@
 
     def __init__(self, server, read_only=0):
         self.server = server
+        self.connection = None
         self.client = None
         self.storage = None
         self.storage_id = "uninitialized"
@@ -212,6 +213,7 @@
         self.read_only = read_only
 
     def notifyConnected(self, conn):
+        self.connection = conn # For restart_other() below
         self.client = self.ClientStorageStubClass(conn)
 
     def notifyDisconnected(self):
@@ -495,7 +497,7 @@
         except:
             self.log("Unexpected error handling waiting transaction",
                      level=zLOG.WARNING, error=sys.exc_info())
-            zeo_storage._conn.close()
+            zeo_storage.connection.close()
             return 0
         else:
             return 1