Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E242010FF9 for ; Mon, 23 Sep 2013 17:09:26 +0000 (UTC) Received: (qmail 18529 invoked by uid 500); 23 Sep 2013 17:09:26 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 18478 invoked by uid 500); 23 Sep 2013 17:09:26 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 18444 invoked by uid 99); 23 Sep 2013 17:09:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Sep 2013 17:09:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 752D19076A2; Mon, 23 Sep 2013 17:09:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brondsem@apache.org To: allura-commits@incubator.apache.org Date: Mon, 23 Sep 2013 17:09:24 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: [#6695] Added logging for LCD timeout and loop detection Updated Branches: refs/heads/master 9f8788007 -> f236c1439 [#6695] Added logging for LCD timeout and loop detection Signed-off-by: Cory Johns 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 Authored: Mon Sep 23 15:11:42 2013 +0000 Committer: Dave Brondsema 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})