Closed
Description
Bug description
Unlike the JdbcJobExecutionDao, the MongoJobExecutionDao is not "upgrading" the status of the jobExecution that was passed in. This can cause behavior where a job status can go from STOPPING back to STARTED by an asynchronous update.
Environment
Spring Batch version: 5.2.1
Java version:17.0.8
which database you use: Mongo 8.0.1
Steps to reproduce
Steps to reproduce the issue:
- Start a Job using JobLauncher
- Attempt to stop the job using JobOperator::stop
- Verify the status in the jobExecution is updated to STOPPING via the JobExplorer
- Wait for end of step to update JobExecution
- Verify the status in the jobExecution is downgraded to STARTED via the JobExplorer
Expected behavior
I would expect the status to not be allowed to downgrade because that is the behavior of the JDBC implementation.