Pause/resume capability for ThreadPoolTaskExecutor
and ThreadPoolTaskScheduler
#30831
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Motivated by checkpoint restore (#29921),
ThreadPoolTaskExecutor
andThreadPoolTaskScheduler
would benefit from aSmartLifecycle
implementation which pauses and resumes task execution onstop
andstart
, even if noSmartLifecycle
-style auto-startup is needed here. This goes along with graceful shutdown enhancements in 6.1 (#27090, #24497) and can nicely be used on its own as well, either through direct calls on the executor bean or throughConfigurableApplicationContext.start/stop
.Task submitters may individually stop and restart their operations, so pause/resume behavior at the thread pool level is not strictly necessary for lifecycle alignment. However, independently submitted one-off tasks (
@Async
etc) and in particular periodic tasks (@Scheduled
etc) can only really be centrally paused and resumed at the executor/scheduler level.The text was updated successfully, but these errors were encountered: