Skip to content

MongoJobRepository with AsyncTaskExecutor leads to WriteConflict #5215

@HaraldStanglMW

Description

@HaraldStanglMW

Bug description
When using a MongoJobRepository and AsyncTaskExecutor, starting a job leads to a WriteConflict on MongoDB.

Environment
Spring Batch Version: 6.0.1
Mongo Version: 8.0.11 and 8.0.12
JDK: tested with 17 and 23

Steps to reproduce
Use an asynchronous task executor, e.g. SimpleAsyncTaskExecutor. See link in example below.

Expected behavior
Job should start without failing with exception.

Minimal Complete Reproducible example
I forked the repo and built a minimal example based on the existing MongoDB tests here:
main...HaraldStanglMW:spring-batch:bug/mongodb-async

Please let me know if you would prefer a self-contained example project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions