Skip to content

During startup scheduled tasks are driven earlier than before causing problems with Spring Batch [SPR-12641] #17242

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-12641 and commented

Spring Batch performs it job registration in response to a ContextRefreshedEvent. In Spring 4.0, the scheduler starts calling scheduled tasks in response to a ContextRefreshedEvent. In Spring 4.1 the latter has changed due #16655 which made ScheduledAnnotationBeanPostProcessor a SmartInitializingSingleton. In short this means that the scheduler now starts calling scheduled tasks before the ContextRefreshedEvent is sent. This means that scheduled tasks that are driven during startup can no longer depend on a Batch job having been registered.


Affects: 4.1.4

Reference URL: spring-projects/spring-boot#2310

Issue Links:

Referenced from: commits 0479ca6, 14a3bf3

0 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions