Skip to content

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

Closed

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:

Activity

  1. spring-projects-issues commented on Mar 5, 2012

    @spring-projects-issues
    CollaboratorAuthor

    LiangFei commented

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

  2. added
    type: bug
    in: core
    status: duplicate
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corestatus: duplicate

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions