[Checkins] SVN: zc.async/trunk/s logging changes

Gary Poster gary at zope.com
Wed Jul 2 13:14:10 EDT 2008


Log message for revision 87932:
  logging changes

Changed:
  U   zc.async/trunk/setup.py
  U   zc.async/trunk/src/zc/async/CHANGES.txt
  U   zc.async/trunk/src/zc/async/job.py

-=-
Modified: zc.async/trunk/setup.py
===================================================================
--- zc.async/trunk/setup.py	2008-07-02 17:02:45 UTC (rev 87931)
+++ zc.async/trunk/setup.py	2008-07-02 17:14:09 UTC (rev 87932)
@@ -71,7 +71,7 @@
 
 setup(
     name='zc.async',
-    version='1.3a5',
+    version='1.3a6',
     packages=find_packages('src'),
     package_dir={'':'src'},
     zip_safe=False,

Modified: zc.async/trunk/src/zc/async/CHANGES.txt
===================================================================
--- zc.async/trunk/src/zc/async/CHANGES.txt	2008-07-02 17:02:45 UTC (rev 87931)
+++ zc.async/trunk/src/zc/async/CHANGES.txt	2008-07-02 17:14:09 UTC (rev 87932)
@@ -1,6 +1,11 @@
 1.3 (unreleased)
 ================
 
+- changed retry policy logs to "WARNING" level, from "INFO" level.
+
+- added "CRITICAL" level logs for "other" commit retries on the
+  RetryCommonForever retry policy.
+
 - added ``remove`` method on queue.
 
 - added helpers for setting up and tearing down Zope 3 functional tests

Modified: zc.async/trunk/src/zc/async/job.py
===================================================================
--- zc.async/trunk/src/zc/async/job.py	2008-07-02 17:02:45 UTC (rev 87931)
+++ zc.async/trunk/src/zc/async/job.py	2008-07-02 17:14:09 UTC (rev 87932)
@@ -103,15 +103,15 @@
             if failure.check(*exc) is not None:
                 count = data_cache.get(key, 0) + 1
                 if max_count is not None and count >= max_count:
-                    zc.async.utils.tracelog.info(
+                    zc.async.utils.tracelog.warning(
                         'Retry policy for job %r is not retrying after %d '
                         'counts of %s occurrences', self.parent, count, key)
                     return False
                 elif count==1 or not count % self.log_every:
-                    zc.async.utils.tracelog.info(
+                    zc.async.utils.tracelog.warning(
                         'Retry policy for job %r requests another attempt '
                         'after %d counts of %s occurrences', self.parent,
-                        count, key)
+                        count, key, exc_info=True)
                 backoff = min(max_backoff,
                               (init_backoff + (count-1) * incr_backoff))
                 if backoff:
@@ -158,10 +158,17 @@
             # that just means we didn't record it.  We actually are going to
             # retry.
             key = 'other'
-            data_cache['other'] = data_cache.get('other', 0) + 1
+            count = data_cache['other'] = data_cache.get('other', 0) + 1
             data_cache['last_other'] = failure
             if 'first_active' not in data_cache:
                 data_cache['first_active'] = self.parent.active_start
+            if count==1 or not count % self.log_every:
+                # this is critical because it is unexpected.  Someone probably
+                # needs to see this. We can't move on until it is dealt with.
+                zc.async.utils.log.critical(
+                    'Retry policy for job %r requests another attempt '
+                    'after %d counts of %s occurrences', self.parent,
+                    count, key, exc_info=True)
         return True # always retry
 
 class NeverRetry(persistent.Persistent):



More information about the Checkins mailing list