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 8D542102A5 for ; Thu, 23 Jan 2014 17:29:52 +0000 (UTC) Received: (qmail 27269 invoked by uid 500); 23 Jan 2014 17:29:46 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 27199 invoked by uid 500); 23 Jan 2014 17:29:44 -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 27148 invoked by uid 99); 23 Jan 2014 17:29:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jan 2014 17:29:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BC1F98BD265; Thu, 23 Jan 2014 17:29:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Thu, 23 Jan 2014 17:29:46 -0000 Message-Id: <10caccf017d34629a6073b55bfeb3810@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/28] git commit: [#7047] further debugging to see if BatchIndexer is in use [#7047] further debugging to see if BatchIndexer is in use Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ffbb4201 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ffbb4201 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ffbb4201 Branch: refs/heads/cj/4257 Commit: ffbb4201aa4922335d0bfa3760199cfa22c07c87 Parents: afdf505 Author: Dave Brondsema Authored: Tue Jan 21 14:30:56 2014 -0500 Committer: Dave Brondsema Committed: Tue Jan 21 14:30:56 2014 -0500 ---------------------------------------------------------------------- Allura/allura/model/session.py | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffbb4201/Allura/allura/model/session.py ---------------------------------------------------------------------- diff --git a/Allura/allura/model/session.py b/Allura/allura/model/session.py index f52d164..5354f87 100644 --- a/Allura/allura/model/session.py +++ b/Allura/allura/model/session.py @@ -70,6 +70,22 @@ class ArtifactSessionExtension(SessionExtension): except Exception: log.exception( "Failed to update artifact references. Is this a borked project migration?") + try: + l = logging.getLogger('allura.debug7047') + from tg import request + task = request.environ.get('task') + except: + pass + else: + try: + if task and task.task_name == 'forgetracker.tasks.bulk_edit': + l.debug('this extension: %s', type(self)) + l.debug('active session extensions are: %s', artifact_orm_session._kwargs.get('extensions')) + l.debug('threadlocal session is for: %s', [s.impl.db for s in artifact_orm_session._session_registry.values()]) + l.debug('current session is: %s', self.session.impl.db) + except Exception: + log.info('error running extra debug pt1', exc_info=True) + self.update_index(self.objects_deleted, arefs) for obj in self.objects_added: g.zarkov_event('create', extra=obj.index_id()) @@ -93,15 +109,19 @@ class ArtifactSessionExtension(SessionExtension): l = logging.getLogger('allura.debug7047') from tg import request task = request.environ.get('task') - if task and task.task_name == 'forgetracker.tasks.bulk_edit': - l.debug('session: %s %s', self.session.impl.db, self.session) - l.debug('arefs: %s', arefs) - l.debug('objects_added: %s', [o._id for o in self.objects_added]) - l.debug('objects_modified: %s', [o._id for o in self.objects_modified]) - l.debug('objects_deleted: %s', [o._id for o in self.objects_deleted]) - l.debug('add_artifacts task: %s', add_task) except: pass + else: + try: + if task and task.task_name == 'forgetracker.tasks.bulk_edit': + #l.debug('session: %s %s', self.session.impl.db, self.session) + l.debug('arefs: %s', arefs) + l.debug('objects_added: %s', [o._id for o in self.objects_added]) + l.debug('objects_modified: %s', [o._id for o in self.objects_modified]) + l.debug('objects_deleted: %s', [o._id for o in self.objects_deleted]) + l.debug('add_artifacts task: %s', add_task) + except Exception: + log.info('error running extra debug pt2', exc_info=True) class BatchIndexer(ArtifactSessionExtension):