Order TaskExecutionAutoConfiguration before TaskSchedulerAutoConfiguration
See original GitHub issueHi, this is a first-timers-only
issue. This means we’ve worked to make it more legible to folks who either haven’t contributed to our codebase before, or even folks who haven’t contributed to open source before.
If that’s you, we’re interested in helping you take the first step and can answer questions and help you out as you do. Note that we’re especially interested in contributions from people from groups underrepresented in free and open source software!
If you have contributed before, consider leaving this one for someone new, and looking through our general ideal-for-contribution
issues. Thanks!
Background
Spring Boot 2.1 has introduced auto-configuration for task execution and scheduling with creation of a ThreadPoolTaskExecutor
and ThreadPoolTaskScheduler
bean if necessary. Both these classes share a common parent which led to a number of issues in the past.
Problem
ThreadPoolTaskExecutor
is conditional on the absence of a java.util.concurrent.Executor
. If TaskSchedulingAutoConfiguration
runs before TaskExecutionAutoConfiguration
, it may create a bean that implements Executor
and therefore the task execution auto-configuration will back off unecessary.
Solution
There is no strict ordering between those two auto-configurations and things are working right now because the chosen order is so that TaskExecutionAutoConfiguration
runs before TaskSchedulingAutoConfiguration
. To make this explicit, we should order them explictly as well. The @AutoConfigureBefore
or @AutoConfigureAfter
annotation can be used for that purpose. Given that TaskSchedulingAutoConfiguration
may be problematic here, it sounds more logical to use @AutoConfigureAfter
on it and refer to TaskExecutionAutoConfiguration
.
Steps to Fix
- Claim this issue with a comment below and ask any clarifying questions you need
- Set up a repository locally following the Contributing Guidelines
- Try to fix the issue following the steps above
- Commit your changes and start a pull request.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
@Omkar-Shetkar , you can head over to issues section of this repository and find issues with status
first-timers-only
to begin with. Remember to claim the issue before anyone else as soon as you decide to work on it.@isank Thanks.