davsclaus opened a new pull request, #27080:
URL: https://github.com/apache/camel/pull/27080

   Fixes CAMEL-25070 (follow-up from CAMEL-25004, #26862).
   
   When the CamelContext stops, `InternalServiceManager.shutdownServices` stops 
the internal services and clears its list. The lazily created services in 
`DefaultCamelContextExtension` (created on first use via `getXxx()`, registered 
with `addService`) are kept in their fields, so on a restart (`stop()` then 
`start()` on the same instance) they are neither registered nor started again. 
After a restart the stream caching strategy, inflight repository, shutdown 
strategy, properties component and exchange factory manager all stayed 
`Stopped` (the ticket only noticed that the stream caching strategy was not 
stopped again, leaving its spool directory behind).
   
   On restart, `forceLazyInitialization` already re-creates the injector and 
type converters. It now also calls 
`DefaultCamelContextExtension.reRegisterServices()`, which registers the kept 
services again through their setters (same flags as the first time; 
`hasService` prevents duplicates), so they are started and stopped with the 
CamelContext again. The services that are not stopped with the CamelContext 
(executor service manager, reactive executor, management assembler) are not 
touched.
   
   Restart-in-place isn't fully supported today; this brings it closer, as a 
step towards reloading on the CamelContext level.
   
   Test: `CamelContextRestartInternalServicesTest` (the service states and the 
stream caching spool directory across a restart) fails without the fix. The 
full camel-core (7966 tests, one timing flake passed on rerun) and 
camel-management (509 tests) suites pass.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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