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

Tim Peters tim.one at comcast.net
Wed Aug 27 12:51:56 EDT 2003


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

Modified Files:
      Tag: ZODB3-3_1-branch
	StorageServer.py 
Log Message:
Queue comments:  started by repairing obvious typos in new comments,
ended up rewriting them because I wasn't clear on what they were saying.
I may have introduced lies.  Please review!


=== ZODB3/ZEO/StorageServer.py 1.74.2.14 => 1.74.2.15 ===
--- ZODB3/ZEO/StorageServer.py:1.74.2.14	Wed Aug 27 11:08:59 2003
+++ ZODB3/ZEO/StorageServer.py	Wed Aug 27 11:51:55 2003
@@ -214,13 +214,16 @@
                 cl.remove(conn.obj)
 
 # Each storage has a waiting queue.  The queue contains two kinds of
-# entries: blocked and non-blocking entries.  A block entry is made by
-# a client that is expecting a response to its vote() before
-# continuing.  A non-blocking entry expects is waiting for an
-# asynchronous message to tell it to continue.  The restart() method
-# of an entry will restart it appropriately.
+# entries:  blocking and non-blocking entries.  A blocking entry
+# represents a client that is waiting for a response to its vote()
+# call.  A non-blocking entry represents a client that made a vote_nb()
+# call and received "VOTE_WAIT" in response; such a client is waiting
+# for an asynchronous message to tell it to continue.  The restart()
+# method of an entry restarts the voting dance appropriately.  The
+# point of the queue is to ensure fairness, via processing vote
+# requests in first-come first-served order.
 
-class WaitQueueEntry:
+class WaitQueueEntry:           # blocking entry
     def __init__(self, delay, client):
         self.delay = delay
         self.client = client # ZEOStorage instance
@@ -236,7 +239,7 @@
         else:
             return 1
 
-class NBQueueEntry:
+class NBQueueEntry:             # non-blocking entry
     def __init__(self, client):
         self.client = client # ClientStub.ClientStorage instance
 
@@ -510,7 +513,7 @@
         strategy = self.strategy
         strategy.tpc_abort()
         self._clear_transaction()
- 
+
     def _clear_transaction(self):
         # Common code at end of tpc_finish() and tpc_abort()
         self.transaction = None
@@ -826,7 +829,7 @@
                 delay.reply(r)
             else:
                 return r
-        
+
     def _prepare(self, new_strategy):
         # The new strategy will always be an ImmediateCommitStrategy.
         new_strategy.tpc_begin(self.txn, self.tid, self.status)




More information about the Zodb-checkins mailing list