Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate error message when using ResourcelessJobRepository with a partitioned step #4732

Open
monnetchr opened this issue Dec 10, 2024 · 2 comments

Comments

@monnetchr
Copy link

Bug description
The ResourcelessJobRepository cannot be used with a Partitioner:

[main] ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing step step in job partitionJob
org.springframework.batch.core.JobExecutionException: Cannot restart step from STARTING status.  The old execution may still be executing, so you may need to verify manually that this is the case.

Steps to reproduce
Simply change spring-batch-samples/src/main/resources/simple-job-launcher-context.xml to use ResourcelessJobRepository and then run spring-batch-samples/src/test/java/org/springframework/batch/samples/partition/file/PartitionFileJobFunctionalTests.java

@monnetchr monnetchr added status: waiting-for-triage Issues that we did not analyse yet type: bug labels Dec 10, 2024
@fmbenhassine
Copy link
Contributor

The resourceless job repository does not support features involving the execution context (including partitioned steps). This is mentioned in the javadocs of the class: https://docs.spring.io/spring-batch/docs/current/api/org/springframework/batch/core/repository/support/ResourcelessJobRepository.html and in the reference docs here: https://docs.spring.io/spring-batch/reference/whatsnew.html#new-resourceless-job-repository

You need to configure another job repository implementation that supports batch-metadata. I am closing this issue now as I believe it answers your concern, but please add a comment if you need more support on this. Thank you.

@fmbenhassine fmbenhassine closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
@fmbenhassine fmbenhassine removed status: waiting-for-triage Issues that we did not analyse yet type: bug labels Dec 10, 2024
@fmbenhassine
Copy link
Contributor

I must admit the error message is confusing, there is no restart in that sample yet the message is mentioning restart. I will re-open this issue and change it into an enhancement.

@fmbenhassine fmbenhassine reopened this Dec 10, 2024
@fmbenhassine fmbenhassine changed the title Cannot use ResourcelessJobRepository with Partitioner Inaccurate error message when using ResourcelessJobRepository with a partitioned step Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants