-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Following up on the latest comments in #13117, DefaultSingletonBeanRegistry.getSingleton(beanName, false) seems to have a specific issue when called from isSingleton and isTypeMatch checks in AbstractBeanFactory: When isSingletonCurrentlyInCreation returns true, we're trying to enter the global lock for an early singleton exposure check... even if we're not allowed to create early references, so only able to check for an existing early reference. By turning earlySingletonObjects into a ConcurrentHashMap and separating that early reference existence check from the creation of early references (which needs to happen within the global lock), we could potentially address a whole range of issues for lookup attempts in concurrent singleton creation scenarios.