Mark bootstrap thread for entire finishBeanFactoryInitialization phase

Closes gh-35398
This commit is contained in:
Juergen Hoeller
2025-10-06 14:08:03 +02:00
parent ecd3dd8883
commit 80e7ee321e
4 changed files with 79 additions and 1 deletions
@@ -936,6 +936,9 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
*/
@SuppressWarnings("unchecked")
protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory) {
// Mark current thread for singleton instantiation with applied bootstrap locking.
beanFactory.prepareSingletonBootstrap();
// Initialize bootstrap executor for this context.
if (beanFactory.containsBean(BOOTSTRAP_EXECUTOR_BEAN_NAME) &&
beanFactory.isTypeMatch(BOOTSTRAP_EXECUTOR_BEAN_NAME, Executor.class)) {