Skip to content

No entry point exists to mark a background job as failed #19806

@jeremystretch

Description

@jeremystretch

Deployment Type

Self-hosted

NetBox Version

v4.3.3

Python Version

3.10

Steps to Reproduce

This issue concerns the current implementation of JobRunner, specifically the way the run() method of a job is executed:

job.start()
cls(job).run(*args, **kwargs)
job.terminate()

Expected Behavior

Setting the status of a job to "failed" (STATUS_FAILED) within the run() method should mark the completed job as failed.

Observed Behavior

The job's status is overwritten with the default "completed" status so long as no exceptions are raised within run(). This is because the terminate() method, called immediately after run(), sets the job's status to "completed" by default.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions