Part of lp.services.job.runner View In Hierarchy
Known subclasses: lp.answers.model.questionjob.QuestionEmailJob, lp.bugs.model.apportjob.ApportJobDerived, lp.code.model.branchjob.BranchJobDerived, lp.code.model.branchmergeproposaljob.BranchMergeProposalJobDerived, lp.code.model.gitjob.GitJobDerived, lp.registry.model.persontransferjob.PersonTransferJobDerived, lp.registry.model.productjob.ProductJobDerived, lp.registry.model.sharingjob.SharingJobDerived, lp.services.job.tests.test_celery.TestJob, lp.services.job.tests.test_runner.NullJob, lp.services.job.tests.test_runner.StaticJobSource, lp.services.webhooks.model.WebhookJobDerived, lp.snappy.model.snapbuildjob.SnapBuildJobDerived, lp.snappy.model.snapjob.SnapJobDerived, lp.soyuz.model.archivejob.ArchiveJobDerived, lp.soyuz.model.distributionjob.DistributionJobDerived, lp.soyuz.model.packagecopyjob.PackageCopyJobDerived, lp.soyuz.model.packagediffjob.PackageDiffJobDerived, lp.soyuz.model.packagetranslationsuploadjob.PackageTranslationsUploadJobDerived, lp.soyuz.model.processacceptedbugsjob.ProcessAcceptedBugsJob, lp.translations.model.pofilestatsjob.POFileStatsJob, lp.translations.model.translationpackagingjob.TranslationPackagingJob
Derived classes should implement IRunnableJob, which requires implementing
IRunnableJob.run. They should have a job
member which implements IJob.
Subclasses may provide getOopsRecipients, to send mail about oopses. If so, they should also provide getOperationDescription.
Method | __eq__ | Undocumented |
Method | __ne__ | Undocumented |
Method | __lt__ | Undocumented |
Method | getOopsRecipients | Return a list of email-ids to notify about oopses. |
Method | getOperationDescription | Undocumented |
Method | getErrorRecipients | Return a list of email-ids to notify about user errors. |
Method | getOopsMailController | Return a MailController for notifying people about oopses. |
Method | getUserErrorMailController | Return a MailController for notifying about user errors. |
Method | notifyOops | Report this oops. |
Method | getOopsVars | See IRunnableJob . |
Method | notifyUserError | See IRunnableJob . |
Method | makeOopsReport | Generate an OOPS report using the given OOPS configuration. |
Method | acquireLease | Undocumented |
Method | taskId | Return a task ID that gives a clue what this job is about. |
Method | runViaCelery | Request that this job be run via celery. |
Method | getDBClass | Undocumented |
Method | celeryCommitHook | Hook function to call when a commit completes. |
Method | celeryRunOnCommit | Configure transaction so that commit runs this job via Celery. |
Method | queue | See IJob . |
Inherited from BaseRunnableJobSource:
Static Method | contextManager | Undocumented |
Return None if there is no-one to notify.
Return None if there is no-one to notify.
IRunnableJob
.Return a task ID that gives a clue what this job is about.
Though we intend to drop the result return by a Celery job (in the sense that we don't care what lazr.jobrunner.celerytask.RunJob.run() returns), we might accidentally create result queues, for example, when a job fails. The messages stored in these queues are often not very specific, the queues names are just the IDs of the task, which are by default just strings returned by Celery's uuid() function.
If we put the job's class name and the job ID into the task ID, we have better chances to figure out what went wrong than by just look for example at a message like
{'status': 'FAILURE', 'traceback': None, 'result': SoftTimeLimitExceeded(1,), 'task_id': 'cba7d07b-37fe-4f1d-a5f6-79ad7c30222f'}
IJob
.