Skip to content

Deadlock on the beanDefinitionMap and singletonObjects [SPR-9199] #13837

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

Closed
spring-projects-issues opened this issue Mar 5, 2012 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 5, 2012

LiangFei opened SPR-9199 and commented

  1. init BeanX (a RPC bean)
  2. RPC -> BeanX -> getBean() // get bean thread
  3. init BeanY // init context thread

The "get bean thread" and the "init context thread" deadlock.

  1. get bean thread:
    (a) DefaultSingletonBeanRegistry.getSingleton(): synchronized(singletonObjects)
    (b) -> getObject() -> DefaultListableBeanFactory.getBeanNames(): synchronized(beanDefinitionMap)

  2. init context thread:
    (a) DefaultListableBeanFactory.preInstantiateSingletons(): synchronized(beanDefinitionMap)
    (b) -> getBean() -> DefaultSingletonBeanRegistry.getSingleton(): synchronized(singletonObjects)


Affects: 2.5.6

Attachments:

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

LiangFei commented

Always first lock the "beanDefinitionMap", may be able to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants