Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add API to recover failed job executions #4876

Closed
@fmbenhassine

Description

This was initially discussed with @Nhoutain in #4831

Abrupt shutdowns of Spring Batch jobs leave the job execution in a running state at the job repository level as Spring Batch doesn't have a chance to update the status correctly (see Aborting a Job). Restarting such failed jobs requires a manual database update as follows:

> update BATCH_JOB_EXECUTION set status = 'FAILED', END_TIME = 'non null value' where job_execution_id = X;
> update BATCH_STEP_EXECUTION set status = 'FAILED' where job_execution_id = X and step_name='failed step name';

There is already an API in the JobOperator to abandon a job execution, so it would be great to provide a new method to mark a job as failed to be able to restart it (which is conceptually the opposite of abandoning a job execution, I think recover would be a good name for such an operation). The goal is to provide an API to mark a job as failed as opposed to asking users to manually execute SQL statements against the database. Providing an API is also necessary to support that feature consistently with other job repositories as well (thinking about No SQL stores for instances).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /