[Zodb-checkins] CVS: Zope3/src/zodb/zeo - client.py:1.4.2.6

Jeremy Hylton jeremy@zope.com
Thu, 13 Feb 2003 19:27:59 -0500


Update of /cvs-repository/Zope3/src/zodb/zeo
In directory cvs.zope.org:/tmp/cvs-serv25369/zeo

Modified Files:
      Tag: ZODB3-2-integration-branch
	client.py 
Log Message:
If notifyConnected() is called after the client is closed, exit
quickly rather than failing with AttributeError on self._cache.

Add missing tid2time() helper.


=== Zope3/src/zodb/zeo/client.py 1.4.2.5 => 1.4.2.6 ===
--- Zope3/src/zodb/zeo/client.py:1.4.2.5	Thu Feb 13 12:57:04 2003
+++ Zope3/src/zodb/zeo/client.py	Thu Feb 13 19:27:59 2003
@@ -45,6 +45,9 @@
 except ImportError:
     ResolvedSerial = 'rs'
 
+def tid2time(tid):
+    return str(TimeStamp(tid))
+
 def get_timestamp(prev_ts=None):
     """Internal helper to return a unique TimeStamp instance.
 
@@ -368,6 +371,12 @@
         This is called by ConnectionManager after it has decided which
         connection should be used.
         """
+
+        if self._cache is None:
+            # the storage was closed, but the connect thread called
+            # this method before it was stopped.
+            return
+        
         # XXX would like to report whether we get a read-only connection
         if self._connection is not None:
             reconnect = 1