Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.12.4, 2.13.2
-
None
-
Unknown
-
Regression
Description
CAMEL-6377 introduced some optimisations in the MDC Logging mechanism which make it lose MDC values when the async routing engine is used.
If we are using an async component such as CXF, the response or done() callback will be issued from a thread NOT managed by Camel. Therefore, we need the MDCCallback to reset ALL MDC values, not just the routeId (as was intended by the commits that caused the regression).
The situation may be salvaged by the fact that underlying MDC implementations use an InheritableThreadLocal, so the first requests after system initialisation may see correct behaviour, because the MDC values from the requesting thread is propagated to the newly initialised threads in the underlying stack's ThreadPool, as the coreThreads are being initialised within the context of the original threads which act like parent threads.
But after those first attempts, odd behaviour is seen and all responses from the async endpoint come back without an MDC.
Attachments
Issue Links
- is broken by
-
CAMEL-6377 Optimize routing engine to reduce stack frames in use during routing and reduce callbacks
- Resolved