Behaviour change in ScheduledAnnotationBeanPostProcessor: canceling scheduled tasks on ContextClosedEvent v6.0 -> v6.1 #33009
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: regression
A bug that is also a regression
Milestone
Use case:
During Graceful Shutdown, we rely on scheduled tasks being executed until final shutdown. This works with springs v6.0.x and stopped working in v6.1
With this change all scheduled tasks are canceled and
continueExistingPeriodicTasksAfterShutdownPolicy
of theThreadPoolTaskScheduler
has no effect here.Here is a spring boot sample application:
After sending
kill -int xyz
to the output of the scheduled task stops.Our current workaround is to use a custom
ScheduledAnnotationBeanPostProcessor
ignoring theContextClosedEvent
The text was updated successfully, but these errors were encountered: