allthingssecurity commented on code in PR #28710:
URL: https://github.com/apache/camel/pull/28710#discussion_r4421848221
##########
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:
Thanks. Keeping the entry is intentional: once the creator has started the
component, `isNotStartedYet` returns false and the entry is never consulted
again, and it goes away with `removeComponent` or at context stop. Removing it
right after the creator's `startService` would need a hook in every
create-configure-start caller (RestProducerFactoryHelper,
RouteBuilder.customize, ...). I'll add a one-line comment saying so with the
next change to this PR, rather than restart CI for a comment alone.
_Claude Code on behalf of allthingssecurity_
--
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]