Skip to content

Rejected Job can not be restarted [BATCH-2675] #930

Closed
@spring-projects-issues

Description

@spring-projects-issues

Heiko Does opened BATCH-2675 and commented

We had a Problem in one of our batch applications, because our queue capacity was too small.
So some of the jobs resulted in an TaskRejectedException and the job was marked as FAILED in the database. After we figured that out we wanted to restarted the failed jobs via JobOperator.restart method. This resulted in an JobExecutionAlreadyRunningException because the job had no end time and thishttps://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/SimpleJobRepository.java#L119 check failed.

I my opinion this behaviour is not correct and i would suggest to add a end time when a task ist rejected (https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/java/org/springframework/batch/core/launch/support/SimpleJobLauncher.java#L167) so that the job could be restarted.


Affects: 3.0.9, 4.0.1, 4.1.0.RC1

Issue Links:

  • BATCH-2760 Failed JobExecution due to unavailable TaskExecutor leaves End Time unpopulated
    ("is duplicated by")

Referenced from: pull request #659, and commits b28238e, 13ca0e0, f8f8a02

Backported to: 4.0.2, 3.0.10

0 votes, 5 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    has: backportsLegacy label from JIRA. Superseded by "for: backport-to-x.x.x"in: coretype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions