Skip to content

Pause/resume capability for ThreadPoolTaskExecutor and ThreadPoolTaskScheduler #30831

Closed
@jhoeller

Description

@jhoeller

Motivated by checkpoint restore (#29921), ThreadPoolTaskExecutor and ThreadPoolTaskScheduler would benefit from a SmartLifecycle implementation which pauses and resumes task execution on stop and start, even if no SmartLifecycle-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 through ConfigurableApplicationContext.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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions