Hi, when scanning the spring issues, I have found one problem related to spring-boot which has been depicted in this website(https://github.com/spring-projects/spring-framework/issues/29725). In my opinion, TaskExecutionAutoConfiguration should import task executor only when develops not set one executor with specific name. It is very likely that develops add Executor bean not used for task executor--This would indirectly lead to spring use SimpleAsyncTaskExecutor to handle async events(which would always start one new thread when events come). My PR is to solve this problem. There might be other solutions like: 1. Extending @ConditionalOnMissingBean to support And/Or logic(Current implementation use Or logic--types or names or annotation) which is really one break change. 2. Simply modify TaskExecutionAutoConfiguration to @ConditionalOnMissingBean(TaskExecutor.class). But from my own experience, a wide range of develops tend to just autowire Executor bean instead of TaskExecutor.
Overall I prefer to minimize the impact only within the TaskExecutionAutoConfiguration which leads to this PR--If developers want to autowire own Executor bean as the task executor, they should specify bean name(Or who knows its Executor serve for what, maybe it just wants to serve their own tasks when task execution must not share).
This PR has one potential problem: After those developers who not specify task executor name have upgraded their spring-boot to this version, they might encounter capacity shortage problem(TaskExecutionProperties default coreSize=8).
Welcome to discuss! Thanks for your time!
Comment From: pivotal-cla
@QuantumXiecao Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@QuantumXiecao Thank you for signing the Contributor License Agreement!
Comment From: wilkinsona
Thanks for the proposal. The current arrangement is intentional and I don't think we should change it. Please see https://github.com/spring-projects/spring-boot/issues/15447 and https://github.com/spring-projects/spring-boot/issues/27513 for details. There's also a note in the documentation about the current behavior.