Intermittent FatalStepExecutionException: JopRepository failure forcing rollback for Multi-threaded Step

Open
#4,751 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, spring
Domain
backend, databases

Research direction

Start at JdbcStepExecutionDao.java:294 and the getDetailsStep configuration, then reproduce the multithreaded chunk step with the provided TaskExecutor, H2, and Java 17 setup. Compare the step-execution version conflict with the ConcurrentModificationException; done means the intermittent failure is explained and a verified resolution or expected behavior is documented.

Written by the indexing model from the issue text.

Description

status: waiting-for-triage type: bug

Bug description
Facing Intermittent FatalStepExecutionException: JopRepository failure forcing rollback Exception for Multi-threaded Step

Below is the error message:

org.springframework.batch.core.step.FatalStepExecutionException: JopRepository failure forcing rollback
java.util.ConcurrentModificationException: null

org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=24 with wrong version (376), where current version is 377
org.springframework.batch.core.repository.dao.JdbcStepExecutionDao.updateStepExecution(JdbcStepExecution.java:294)

Environment
Spring Batch version: 5.13, Java 17, H2 database

Steps to reproduce
We have a step like below with taskExecutor

TaskExecutor taskExecutor, JobRepository jobRepository, PlatformTransactionManager transactionManager Beans are autowired.

   StepBuilder getStepBuilder(){
   new StepBuilder("sampleStep", jobRepository);
}

@Bean
public Step getDetailsStep() {
	return getStepBuilder()
				.<String, String>chunk(10, transactionManager)
				.reader(itemReader())
                                .processor(itemProcessor)
				.writer(itemWriter())
				.taskExecutor(taskExecutor)
				.build();
    




Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-projects/spring-batch

All issues in spring-projects/spring-batch

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.