[logback-user] Is MDC thread safe?

Ceki Gülcü ceki at qos.ch
Sun Aug 28 18:42:11 CEST 2011


Looks like a bug. Could you please enter a bug report?

On 28/08/2011 4:39 PM, Odd Man wrote:
> I've read that logback is thread safe, but I got exception using MDC.
> Is it bug or MDC access should be syncronized?
>
> java.util.ConcurrentModificationException: null
> 	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) ~[na:1.6.0_26]
> 	at java.util.HashMap$EntryIterator.next(HashMap.java:834) ~[na:1.6.0_26]
> 	at java.util.HashMap$EntryIterator.next(HashMap.java:832) ~[na:1.6.0_26]
> 	at java.util.HashMap.putAll(HashMap.java:523) ~[na:1.6.0_26]
> 	at ch.qos.logback.classic.util.LogbackMDCAdapter.duplicateAndInsertNewMap(LogbackMDCAdapter.java:69)
> ~[logback-classic-0.9.29.jar:na]
> 	at ch.qos.logback.classic.util.LogbackMDCAdapter.put(LogbackMDCAdapter.java:95)
> ~[logback-classic-0.9.29.jar:na]
> 	at org.slf4j.MDC.put(MDC.java:112) ~[slf4j-api-1.6.1.jar:1.6.1]


-- 
QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, 
is looking to hire talented software developers. For further details, 
see http://logback.qos.ch/job.html


More information about the Logback-user mailing list