Skip to content

Deadlock in DefaultListableBeanFactory/DefaultSingletonBeanRegistry [SPR-10020] #14654

Closed

Description

@spring-projects-issues

Glyn Normington opened SPR-10020 and commented

A user of Gemini Blueprint (nee Spring DM) has raised a bug ([1]) about a deadlock which appears to be caused by the combination of DefaultListableBeanFactory and DefaultSingletonBeanRegistry. I'm not sure which version of Spring framework they were using, but I checked the code at HEAD and the deadlock still appears to be possible.

The deadlock is easy to see in the bug description and involves two threads.

  1. The thread "EclipseGeminiBlueprintExtenderThread-20" has synchronised on ConcurrentHashMap@3b38bbfa in DefaultListableBeanFactory.resetBeanDefinition while calling destroySingleton which then blocks waiting for LinkedHashMap@9c772ae.

  2. The thread "Gemini Blueprint context shutdown thread" has synchronised on LinkedHashMap@9c772ae in DefaultSingletonBeanRegistry.destroySingletons while calling destroySingleton which results in a call to removeSingleton which then blocks waiting for ConcurrentHashMap@3b38bbfa.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=384080


Affects: 3.1.3, 3.2 RC1

Reference URL: https://bugs.eclipse.org/bugs/show_bug.cgi?id=384080

Issue Links:

Activity

  1. spring-projects-issues commented on Nov 26, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Glyn Normington commented

    Thanks Juergen!

    Also, from the user who raised the Blueprint bug:

    (In reply to comment #4)

    (In reply to comment #3)

    A fix has been scheduled for Spring framework 3.2 RC2 and 3.1.4.

    Perfect - thanks a lot for the effort!

  2. added
    type: bug
    in: core
    on Jan 11, 2019
  3. added this to the 3.1.4 milestone 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: coretype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions