[slf4j-user] BasicMDCAdapter thread issue

Ceki Gülcü ceki at qos.ch
Thu Oct 21 00:25:00 CEST 2010


Hi Raimo,

Please enter a bug report so that this issue can be fixed asap.

TIA

On 20/10/2010 1:57 PM, Raimo Järvi wrote:
> Hi,
>
> I've had some thread issues with Apache FTP server
> (http://mina.apache.org/ftpserver/) and it looks like the problems
> might be connected to SLF4J. I'm using the jdk14 binding in SLF4J
> version 1.5.11, but version 1.6.1 seems to have the same issue.
>
> Sometimes threads in the FTP server go to an infinite loop and the
> server becomes unresponsive. When I do a thread dump, I see something
> like this (FTP server classes removed from the stack trace):
>
> java.lang.Thread.State: RUNNABLE
> 	at java.util.HashMap.removeEntryForKey(Unknown Source)
> 	at java.util.HashMap.remove(Unknown Source)
> 	at org.slf4j.helpers.BasicMDCAdapter.remove(BasicMDCAdapter.java:91)
> 	at org.slf4j.MDC.remove(MDC.java:150)
>
> java.lang.Thread.State: RUNNABLE
> 	at java.util.HashMap.put(Unknown Source)
> 	at org.slf4j.helpers.BasicMDCAdapter.put(BasicMDCAdapter.java:70)
> 	at org.slf4j.MDC.put(MDC.java:109)
>
> I've looked at BasicMDCAdapter code and it looks like the same HashMap
> may be returned for multiple threads. Is BasicMDCAdapter not thread
> safe or am I missing something?
>
> Regards,
> Raimo
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://qos.ch/mailman/listinfo/slf4j-user



More information about the slf4j-user mailing list