You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/09/23 17:11:59 UTC
git commit: [#6695] Added logging for LCD timeout and loop detection
Updated Branches:
refs/heads/cj/6695 f77723602 -> 0c4c12ac5
[#6695] Added logging for LCD timeout and loop detection
Signed-off-by: Cory Johns <cj...@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/0c4c12ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0c4c12ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0c4c12ac
Branch: refs/heads/cj/6695
Commit: 0c4c12ac5ea7606f6d4a3ac07a01c09bb9b5fc05
Parents: f777236
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Sep 23 15:11:42 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Sep 23 15:11:42 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/0c4c12ac/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})