Back Forum Reply New

Partitioned Steps ends with STARTED status

Hi,
I'm implementing a 2 steps job:
- one simple step.
- one partitioned step.

For the partitioned step, I m using a SimpleAsyncTaskExecutor executor.
The grid size is 50.
The partition step uses a reader (hibernate select), a processor (soap call) and a writer (hibernate update).

For testing purpose, the processor always throws RuntimeException in order to force all Partitioned Steps to stop with status FAILED.

For a reason I dont understand, some step partitions at the end of the run are still in STARTED status, while the Master Step is in UNKNOWN or FAILED status (random).
For theses partitions, the READ_COUNT is 0 (1 for the others partition in status FAILED).

From the logs, I can see that the thread in charge of the partition is doing his job quite well:
- the reader is called and returned 10 elements to process
- the process is called and raise a RuntimeException
- the onProcessError method is called
- the afterStep method is called and log that the status of the step is FAILED (stepExecution.getExitStatus().getExitCode())
But, in the end, this status is not updated in the Spring Batch Repository database.

When using SyncTaskExecutor, there is no problems, all the steps and job execution are always in FAILED status.

I have no idea what is the problem.

Need some help

Sounds like a race condition.  You are using a standard TaskExecutorPartitionHandler?  Which version of Spring Batch?  Any chance you can whittle this down to a minimal test case?
¥
Back Forum Reply New