gnodet-bot commented on code in PR #28710:
URL: https://github.com/apache/camel/pull/28710#discussion_r4421830776


##########
core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java:
##########
@@ -563,7 +566,12 @@ public Component getComponent(String name, boolean 
autoCreateComponents, boolean
             // atomic operation to get/create a component. Avoid global locks.
             final Component component = components.computeIfAbsent(name, comp 
-> {
                 created.set(true);
-                return initComponent(name, autoCreateComponents);
+                Component answer = initComponent(name, autoCreateComponents);
+                if (answer != null && !autoStart) {
+                    // marked before other threads can get it
+                    componentsCreatedWithoutAutoStart.put(name, answer);
+                }

Review Comment:
   💡 **Minor (non-blocking):** This entry is never removed when the creator 
finishes calling `startService` — only `removeComponent` or `doStop` cleans it 
up. The stale entry is harmless (the `isNotStartedYet` guard returns `false` 
for a started component, so it's never consulted after that point), but a 
comment here noting the intentional retention — or a cleanup after the caller 
starts the component — would improve long-term clarity.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to