-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Concurrency Exception during bean configuration related to not thread safe getBeanPostProcessor access [SPR-17286] #21819
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
Comments
Juergen Hoeller commented So is there a Also, any idea why this only happens in 4.3.x but not in 5.x anymore, since the general post-processor management is largely the same? |
Sebastien Fuchs commented I'm preparing a simple fix of AbstractAutowireCapableBeanFactory (using ReentrantLock). |
Sebastien Fuchs commented Sorry about the version. Did not test enough out of 4.3.x. My mistake. The problem comes from the way Akka creates actors: through its own dispatcher threads. So the actor beans are getting autowired from those threads and not the bootstrap thread. Code derived from: https://github.com/typesafehub/activator-akka-java-spring/tree/master/src/main/java/sample |
Juergen Hoeller commented Even in such an environment, I wonder where the late registration of If we have to be defensive about |
Sebastien Fuchs commented Fix submitted: #1962 |
Juergen Hoeller commented Thanks for the suggested patch! However, as mentioned above, a |
Sebastien Fuchs commented And it's an inner bean if that helps. Could it be PostConstruct of the bean itself (the actor then) that modifies the beanPostProcessors ? |
Sebastien Fuchs commented CopyOnWriteArrayList is surely much safer. But much slower. Just tell me if you prefer a new PR using CopyOnWriteArrayList. |
Juergen Hoeller commented Along the lines of my previous comment and an earlier change in #17034, I went with a |
Juergen Hoeller commented I eventually reverted the fix in 4.3.x since it turned out to cause subtle side effects for callers to All in all, this is addressed in 5.1 and also 5.0.10 now. For any concurrent |
Sebastien Fuchs opened SPR-17286 and commented
Happens during initialisation of projects using Akka actors enriched by Spring beans ex:
Spring service -> akka actor created and autowired during postConstruct.
Log:
Affects: 4.3.19
Issue Links:
Referenced from: commits d15abfd, fa06faa, 1756f83, 0d1bf52, 4642c32
Backported to: 5.0.10
The text was updated successfully, but these errors were encountered: