-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
has: minimal-exampleBug reports that provide a minimal complete reproducible exampleBug reports that provide a minimal complete reproducible examplein: infrastructuretype: bug
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:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
has: minimal-exampleBug reports that provide a minimal complete reproducible exampleBug reports that provide a minimal complete reproducible examplein: infrastructuretype: bug