Merge lp:~gmb/launchpad/blobjob-cronscript-bug-513190 into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Graham Binns on 2010-02-12 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~gmb/launchpad/blobjob-cronscript-bug-513190 |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
522 lines (+311/-105) (has conflicts) 8 files modified
configs/development/launchpad-lazr.conf (+3/-0) configs/testrunner/launchpad-lazr.conf (+5/-0) cronscripts/process-apport-blobs.py (+33/-0) database/schema/security.cfg (+8/-0) lib/canonical/config/schema-lazr.conf (+7/-1) lib/canonical/launchpad/browser/temporaryblobstorage.py (+25/-1) lib/lp/bugs/tests/test_apportjob.py (+226/-103) lib/lp/services/mail/sendmail.py (+4/-0) Text conflict in lib/canonical/launchpad/browser/temporaryblobstorage.py Text conflict in lib/lp/bugs/tests/test_apportjob.py Text conflict in lib/lp/services/mail/sendmail.py |
| To merge this branch: | bzr merge lp:~gmb/launchpad/blobjob-cronscript-bug-513190 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Abel Deuring (community) | code | 2010-02-12 | Approve on 2010-02-12 |
|
Review via email:
|
|||
Commit Message
Add a cronscript for running ProcessApportBl
| Graham Binns (gmb) wrote : | # |
| Graham Binns (gmb) wrote : | # |
Non-crazy diff:
=== modified file 'configs/
--- configs/
+++ configs/
@@ -221,6 +221,9 @@
error_dir: /var/tmp/poimport
oops_prefix: POI
+[process_
+error_dir: /var/tmp/lperr
+
[supermirror_
error_dir: /var/tmp/
oops_prefix: SMP
=== modified file 'configs/
--- configs/
+++ configs/
@@ -193,6 +193,11 @@
error_dir: /var/tmp/
oops_prefix: TPOI
+[process_
+dbuser: process-
+oops_prefix: TAPPORTBLOB
+error_dir: /var/tmp/lperr.test
+
[rosettabranches]
oops_prefix: TRSBR
error_dir: /var/tmp/
=== added file 'cronscripts/
--- cronscripts/
+++ cronscripts/
@@ -0,0 +1,33 @@
+#!/usr/
+#
+# Copyright 2010 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+# pylint: disable-msg=W0403
+
+"""Process uploaded Apport BLOBs."""
+
+__metaclass__ = type
+
+import _pythonpath
+
+from canonical.
+
+from lp.services.
+from lp.bugs.
+
+
+class RunProcessAppor
+ """Run ProcessApportBl
+
+ config_name = 'process_
+ source_interface = IProcessApportB
+
+ def main(self):
+ errorlog.
+ return super(RunProces
+
+
+if __name__ == '__main__':
+ script = RunProcessAppor
+ script.
=== modified file 'database/
--- database/
+++ database/
@@ -1897,3 +1897,11 @@
public.bug = SELECT, UPDATE
public.job = SELECT, UPDATE, DELETE
public.bugjob = SELECT, DELETE
+
+[process-
+type=user
+groups=script,read
+public.job = SELECT, UPDATE, DELETE
+public.apportjob = SELECT, INSERT, UPDATE, DELETE
+public.
+public.
=== modified file 'lib/canonical/
--- lib/canonical/
+++ lib/canonical/
@@ -28,7 +28,6 @@
# datatype: string
base_url: http://
-
[calculate_
# The database user which will be used by this process.
# datatype: string
@@ -37,6 +36,13 @@
error_dir: none
copy_to_zlog: false
+[process_
+# The database user which will be used by this process.
+# datatype...
| Abel Deuring (adeuring) wrote : | # |
Hi Graham,
anice branch. But please remove the "import pdb; pdb.set_trace()" from temporaryblobst

This branch adds a cronscript to run ProcessApportBlob jobs. These jobs are created when a new Apport BLOB is uploaded. The idea is that the processing of large BLOBs should be done outside the request, so that +filebug will no longer time out due to the size of uploaded data.
== configs/ development/ launchpad- lazr.conf ==
- I've added an error_dir directive for the process_ apport_ blobs
script.
== configs/ testrunner/ launchpad- lazr.conf ==
- I've added error_dir and oops_prefix directives for the apport_ blobs script.
process_
== cronscripts/ process- apport- blobs.py ==
- I've created a new cronscript based on JobCronScript to run the tBlob jobs.
ProcessAppor
== database/ schema/ security. cfg ==
- I've added the necessary permissions for the script's db user.
== lib/canonical/ config/ schema- lazr.conf ==
- I've added basic config options for the script.
== lib/canonical/ launchpad/ browser/ temporaryblobst orage.py ==
- I've updated the TemporaryBlobSt orageAddView to ensure that errors
are handled properly if the librarian isn't available for some
reason.
== lib/lp/ bugs/tests/ test_apportjob. py ==
- I've added a test to ensure that the cronscript runs.
No lint.