From patchwork Mon Oct 17 23:57:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 4716 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1F74223E03 for ; Mon, 17 Oct 2011 23:57:16 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 06A40A1857E for ; Mon, 17 Oct 2011 23:57:16 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so143801bkb.11 for ; Mon, 17 Oct 2011 16:57:15 -0700 (PDT) Received: by 10.223.77.69 with SMTP id f5mr139263fak.3.1318895835608; Mon, 17 Oct 2011 16:57:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.1.71 with SMTP id 7cs26078lak; Mon, 17 Oct 2011 16:57:15 -0700 (PDT) Received: by 10.216.70.1 with SMTP id o1mr24185wed.66.1318895834055; Mon, 17 Oct 2011 16:57:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id m9si62717weq.118.2011.10.17.16.57.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Oct 2011 16:57:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RFx3R-0003lW-K4 for ; Mon, 17 Oct 2011 23:57:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 8B734E0996 for ; Mon, 17 Oct 2011 23:57:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 85 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 85: work around django bug that meant start_time was usually wrong on job page Message-Id: <20111017235713.19659.83630.launchpad@ackee.canonical.com> Date: Mon, 17 Oct 2011 23:57:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14157"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 11ab296efc276bb0611c04e315a8e985663e4f2e Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-scheduler/workaround-django-tz-bug-861149/+merge/79634 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 85 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Tue 2011-10-18 12:55:24 +1300 message: work around django bug that meant start_time was usually wrong on job page modified: lava_scheduler_daemon/dbjobsource.py --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === modified file 'lava_scheduler_daemon/dbjobsource.py' --- lava_scheduler_daemon/dbjobsource.py 2011-08-22 03:20:17 +0000 +++ lava_scheduler_daemon/dbjobsource.py 2011-10-17 23:35:27 +0000 @@ -56,7 +56,7 @@ def getBoardList(self): return self.deferForDB(self.getBoardList_impl) - @transaction.commit_manually() + @transaction.commit_on_success() def getJobForBoard_impl(self, board_name): while True: device = Device.objects.get(hostname=board_name) @@ -93,15 +93,8 @@ job.save() json_data = json.loads(job.definition) json_data['target'] = device.hostname - transaction.commit() return json_data else: - # We don't really need to rollback here, as no modifying - # operations have been made to the database. But Django is - # stupi^Wconservative and assumes the queries that have been - # issued might have been modifications. - # See https://code.djangoproject.com/ticket/16491. - transaction.rollback() return None def getJobForBoard(self, board_name):