Skip to content

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

Closed
@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions