Skip to content

Continue with pre-instantiation when current bean is in creation already #34349

Closed
@jhoeller

Description

@jhoeller

As of 6.2, lenient locking may lead to BeanCurrentlyInCreationException on pre-instantiation if another thread has picked up this bean outside of a singleton lock already. While this should never happen in a well-designed bootstrap arrangement where common beans are supposed to come first (through depends-on declaration in dependent beans even for async initialization needs), we can safely ignore a top-level BeanCurrentlyInCreationException on mainline pre-instantiation (in the main bootstrap thread) and move on. Effectively, the skipped bean is expected to concurrently finish its initialization in its other thread while the main thread continues with initializing the rest of the non-lazy singleton beans.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions