Joern Huxhorn commented on Improvement LOGBACK-624

+1 for replacing InheritableThreadLocal with ThreadLocal. InheritableThreadLocal is essentially introducing an uncontrollable side effect to the MDC.

The issue can be circumvented by calling MDC.clear() before doing any work in a Runnable/Callable if those are in your own codebase but otherwise you are out of luck.

This could even leak sensitive data in a worst-case scenario. Such data probably shouldn't end up in the MDC in the first place but I wouldn't expect it to - sometimes - "leak into unrelated Threads" by calling Executor.execute().

I really don't see a use case for the inheritance functionality. Those use cases may exist (and the functionality could be manually emulated in that circumstance) but they are certainly not the behavior expected by default. I'd suspect that if we changed this right away (breaking compatibility in the process, strictly speaking) that no one would ever complain about it since no one would miss the current functionality.

And, yes, this has bitten me in the past. It was quite astonishing.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
logback-dev mailing list
logback-dev@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-dev

Reply via email to