incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/3] git commit: [#6695] Added logging for LCD timeout and loop detection
Date Mon, 23 Sep 2013 17:09:24 GMT
Updated Branches:
  refs/heads/master 9f8788007 -> f236c1439


[#6695] Added logging for LCD timeout and loop detection

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/f236c143
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f236c143
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f236c143

Branch: refs/heads/master
Commit: f236c14395dee45086cc7c6375fdb7fd2c70b0c6
Parents: 9d029eb
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Mon Sep 23 15:11:42 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Sep 23 17:09:04 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f236c143/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index b371295..f02f122 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -145,6 +145,7 @@ class RepositoryImplementation(object):
         Return a mapping {path: commit_id} of the _id of the last
         commit to touch each path, starting from the given commit.
         '''
+        orig_commit = commit
         timeout = asint(config.get('lcd_timeout', 60)) * 1000
         start_time = time()
         paths = set(paths)
@@ -152,9 +153,8 @@ class RepositoryImplementation(object):
         seen_commits = set()
         while paths and commit:
             if time() - start_time > timeout:
+                log.error('last_commit_ids timeout for %s on %s', orig_commit._id, ', '.join(paths))
                 return result
-            if commit._id in seen_commits:
-                return result  # sanity check for bad data (loops)
             seen_commits.add(commit._id)
             changed = paths & set(commit.changed_paths)
             result.update({path: commit._id for path in changed})
@@ -164,6 +164,9 @@ class RepositoryImplementation(object):
             # computed wrong (not including children of added trees).
             # Can be removed once all projects have had diffs / LCDs refreshed.
             parent = commit.get_parent()
+            if parent and parent._id in seen_commits:
+                log.error('last_commit_ids loop detected at %s for %s on %s', parent._id,
orig_commit._id, ', '.join(paths))
+                return result  # sanity check for bad data (loops)
             if parent:
                 changed = set([path for path in paths if not parent.has_path(path)])
                 result.update({path: commit._id for path in changed})


Mime
View raw message