mayurbm commented on PR #25771:
URL: https://github.com/apache/camel/pull/25771#issuecomment-5432916024

   Hi @davsclaus, thank you for the detailed analysis — you identified the root 
cause precisely.
   
   Implemented the systemic fix you recommended in a new PR: 
**https://github.com/apache/camel/pull/25775**
   
   The fix moves the three null-and-recreate calls (`resetInjector`, 
`resetTypeConverterRegistry`, `resetTypeConverter`) from 
`forceStopLazyInitialization()` (tail of `doStop()`) to the start of 
`forceLazyInitialization()` (start of `doStart()`), guarded by `firstStartDone`:
   
   - `getTypeConverter()` is **never null** during the stopped/idle window — 
all ~200 unguarded call sites fixed at once with no null-checks or sentinels 
anywhere
   - Restart-in-place (`stop()`/`start()` on the same instance) preserved: 
`firstStartDone` ensures resets run only on a genuine restart, not the first 
start
   - `forceStopLazyInitialization()` is now intentionally empty with a comment 
explaining why
   
   This PR supersedes both #25760 and #25771.
   
   Local validation:
   - `mvn formatter:format impsort:sort` — no changes needed
   - `TypeConverterNotNullAfterStopTest`: Tests run: 2, Failures: 0 (converter 
non-null after stop + restart-in-place works)


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