[Zope-CVS] CVS: Packages/zasync/client/zasync - client.py:1.5 plugins.py:1.4

Gary Poster gary at zope.com
Tue Oct 26 10:35:34 EDT 2004


Update of /cvs-repository/Packages/zasync/client/zasync
In directory cvs.zope.org:/tmp/cvs-serv28176/client/zasync

Modified Files:
	client.py plugins.py 
Log Message:
tweak backoff interval for assigning tasks; add backoff interval to calling zope_exec start_worker so that existing threads have a better chance to grab new jobs before we create an unnecessary new thread.



=== Packages/zasync/client/zasync/client.py 1.4 => 1.5 ===
--- Packages/zasync/client/zasync/client.py:1.4	Thu Oct 21 15:29:59 2004
+++ Packages/zasync/client/zasync/client.py	Tue Oct 26 10:35:34 2004
@@ -133,7 +133,7 @@
     if is_connected():
         server_retry_start = None
         delay = 0
-        interval = 0.25
+        interval = 0.05
         while server_retries:
             call, args, kwargs = server_retries.pop(0)
             reactor.callLater(delay, call, *args, **kwargs)
@@ -214,7 +214,7 @@
             global tool_retries
             retries = tool_retries.pop(path)
             delay = 0
-            interval = 0.25
+            interval = 0.05
             # schedule all the past calls
             found = False
             for call, args, kwargs in retries:
@@ -266,7 +266,7 @@
                 poll_interval = tool.poll_interval
                 tool.heartbeat()
                 delay = 0
-                interval = 0.25 # XXX make configurable?
+                interval = 0.05
                 for zopeDeferred in tool.acceptAll():
                     if zopeDeferred.remainingSeconds() <= 0:
                         # don't bother calling if it has already timed out


=== Packages/zasync/client/zasync/plugins.py 1.3 => 1.4 ===
--- Packages/zasync/client/zasync/plugins.py:1.3	Thu Oct 21 15:29:59 2004
+++ Packages/zasync/client/zasync/plugins.py	Tue Oct 26 10:35:34 2004
@@ -270,7 +270,8 @@
     # zope_exec, above, or else the data structures the worker thread expects
     # are not (necessarily) in place yet.  This is in a separate reactor call
     # just to free the reactor up a bit to do other work.
-    start_worker() # this must be after the put, because start_worker only
+    reactor.callLater(0.05, start_worker)
+    # this must be after the put, because start_worker only
     # creates a thread if it can see that one is necessary
 
 def normalize_path(path):
@@ -323,6 +324,7 @@
             # thread to possibly start in a tenth of a second (giving active
             # threads a healthy chance to take a stab at the queue before we
             # look again)
+    logger.debug('out of start_worker')
 
 def abandon_zope_exec(failure, zopeDeferredTuple):
     """this is an errback for the twisted deferred that makes sure that a



More information about the Zope-CVS mailing list