Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions