Following up on https://github.com/spring-projects/spring-framework/issues/35254#issuecomment-3212944107, there is a need to clarify the semantics of taskTerminationTimeout
on SimpleAsyncTaskExecutor/Scheduler
- and potentially to make the time of interruption configurable, similar to waitForTasksToCompleteOnShutdown
on ThreadPoolTaskExecutor/Scheduler
.
However, the common scenario is not quite analogous since loosely executing individual Threads are not being stopped as part of lifecycle management: With SimpleAsyncTaskExecutor
as well as SimpleAsyncTaskScheduler
, the only stopping of such loose tasks happens on close()
, so it seems sensible to leave some room for them to complete based on their own lifecycle management (as of 6.2.10). For scenarios where immediate interruption is nevertheless desirable, we could provide a configuration flag, effectively opting into pre-6.2.10 behavior.