Open
Description
If in a multi-threaded step a @StepScope bean cannot be created then the batch just hangs waiting in TaskExecutorRepeatTemplate#waitForResults L172.
In my batch I want to pass in the pool size as a job parameter to the TaskExecutor used in the step. If this parameter is missing or cannot be converted into an int, then an exception is added to the deferred list but the TaskExecutorRepeatTemplate thinks a result is still coming from the ResultQueueResultHolder.
Here is my task executor:
@Bean
@StepScope
public TaskExecutor taskExecutor(@Value("#{jobParameters['poolSize']}") int poolSize) {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(poolSize);
executor.setMaxPoolSize(poolSize);
return executor;
}
Here's a pull request demonstrating the problem: