l.s.j.r.BaseRunnableJob(BaseRunnableJobSource) : class documentation

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

Base class for jobs to be run via JobRunner.

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
def __eq__(self, job):
Undocumented
def __ne__(self, job):
Undocumented
def __lt__(self, job):
Undocumented
def getOopsRecipients(self):
Return a list of email-ids to notify about oopses.
def getOperationDescription(self):
Undocumented
def getErrorRecipients(self):
Return a list of email-ids to notify about user errors.
def getOopsMailController(self, oops_id):
Return a MailController for notifying people about oopses.

Return None if there is no-one to notify.

def getUserErrorMailController(self, e):
Return a MailController for notifying about user errors.

Return None if there is no-one to notify.

def notifyOops(self, oops):
Report this oops.
def getOopsVars(self):
See IRunnableJob.
def notifyUserError(self, e):
See IRunnableJob.
def makeOopsReport(self, oops_config, info):
Generate an OOPS report using the given OOPS configuration.
def acquireLease(self, duration=None):
Undocumented
def taskId(self):

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'}
def runViaCelery(self, ignore_result=False):
Request that this job be run via celery.
def getDBClass(self):
Undocumented
def celeryCommitHook(self, succeeded):
Hook function to call when a commit completes.
def celeryRunOnCommit(self):
Configure transaction so that commit runs this job via Celery.
def queue(self, manage_transaction=False, abort_transaction=False):
See IJob.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.