-
Notifications
You must be signed in to change notification settings - Fork 37.8k
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
@Async aspect should clear cached executors when different BeanFactory set #28201
Conversation
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java
Outdated
Show resolved
Hide resolved
spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java
Outdated
Show resolved
Hide resolved
@cdalexndr, is there an existing issue associated with this "fix"? If not, can you please add more information to this PR's description to explain the rationale and what error cases the proposed change fixes? |
@sbrannen updated description |
While I do not see the need for a Thanks for the PR, in any case! |
When using AspectJ and multi-context (ex: testing), the bean factory needs to be changed on the singleton aspect.
This fix clears cached method executors when changing bean factory.
If the first context was previously closed with the executors, then an error will be thrown when trying to reuse the closed executor.