Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScheduledAnnotationBeanPostProcessor should unregister tasks on destruction of individual beans [SPR-12216] #16830

spring-issuemaster opened this issue Sep 17, 2014 · 1 comment


Copy link

@spring-issuemaster spring-issuemaster commented Sep 17, 2014

Juergen Hoeller opened SPR-12216 and commented

At this point, ScheduledAnnotationBeanPostProcessor cancels all tasks on shutdown of the entire application context. While this is generally fine for the typical singleton bean case, @Scheduled may also be placed on non-singleton beans which we should track for individual unregistration on destruction of each such individual bean.

This is a follow-up to #16803.

Issue Links:

  • #16803 Scheduled/JmsListenerAnnotationBeanPostProcessor needlessly scans every scoped instance
  • #18858 Scheduled tasks aren't cancelled on ScheduledTaskRegistrar destruction anymore
  • #19230 Performance regression when scheduling is enabled and context contains URL beans
  • #18739 Improve reference documentation for Task Execution and Scheduling about bean scopes
  • #17470 @Scheduled methods in @Lazy beans are not scheduled

Referenced from: commits ab478d1

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 4, 2016

Juergen Hoeller commented

As of 4.3 RC2, ScheduledAnnotationBeanPostProcessor features a revised registration mechanism capable of tracking individual bean instances, both on creation for beans of any scope and on destruction of each individual bean. In other words, @Scheduled works on any Spring-managed bean now, not just on non-lazy singleton beans anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.