Closed
Description
Vivien HENRIET opened SPR-10307 and commented
The refresh()
method of AnnotationConfigApplicationContext
is not thread safe anymore.
It works fine in 3.1.2. The regression has bean introduce with the 3.1.3 release.
To reproduce:
-create 2 application contexts
-register the same configuration class
-call the refresh method on application context simultaneously
Now, there is a good chance that both application context share the same beans.
A small Java program is attached to reproduce the issue.
Affects: 3.1.3, 3.1.4, 3.2.1, 3.2.2
Attachments:
- threadsafe.zip (2.46 kB)
Issue Links:
- Use of same @Configuration class across multiple ApplicationContexts is not threadsafe [SPR-10936] #15564 Use of same
@Configuration
class across multiple ApplicationContexts is not threadsafe ("is duplicated by") - Singleton-scoped @Bean methods behave like prototypes in a Spring DM environment [SPR-5932] #10601 Singleton-scoped
@Bean
methods behave like prototypes in a Spring DM environment - Prevent memory leaks with @Configuration beans [SPR-9851] #14484 Prevent memory leaks with
@Configuration
beans - Java config FactoryBean proxy causes class loader leak [SPR-9274] #13912 Java config FactoryBean proxy causes class loader leak
- Creating ApplicationContexts from multiple threads causes ConcurrentModificationException [SPR-10543] #15173 Creating ApplicationContexts from multiple threads causes ConcurrentModificationException
Referenced from: commits 30b21a9, 6405551, fffeaee
0 votes, 6 watchers