question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order TaskExecutionAutoConfiguration before TaskSchedulerAutoConfiguration

See original GitHub issue

Hi, 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:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Feb 19, 2019

Hi @snicoll , seems this issue is closed. I am eagerly looking for opportunities to contribute to spring and open source projects. In future, how do I find this kind of issues for beginners like me to contribute to ?

@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.

0reactions
Omkar-Shetkarcommented, Feb 19, 2019

@isank Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Order TaskExecutionAutoConfiguration before ... - GitHub
In Spring Boot 2.1.2, if ThreadPoolTaskExecutor and ThreadPoolTaskScheduler exist, the two instance beans will be automatically configured, ...
Read more >
SpringMVC对Servlet3.0异步请求的支持 - CSDN博客
相关issue: Order TaskExecutionAutoConfiguration before TaskSchedulerAutoConfiguration package com.bruce.webmvc.controller; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found