[jboss-jira] [JBoss JIRA] (LOGMGR-35) All threads share the same MDC FastCopyHashMap

Stephan Classen (Created) (JIRA) jira-events at lists.jboss.org
Wed Dec 7 05:46:41 EST 2011


All threads share the same MDC FastCopyHashMap
----------------------------------------------

                 Key: LOGMGR-35
                 URL: https://issues.jboss.org/browse/LOGMGR-35
             Project: JBoss Log Manager
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: core
    Affects Versions: 1.2.0.GA
            Reporter: Stephan Classen
            Assignee: David Lloyd
            Priority: Critical


All threads share the very same instance of the FastCopyHashMap.
This causes the use of a MDC command (put/remove/etc) to effect ALL running threads.

The problem lies in the class org.jboss.logmanager.MDC
The static inner class Holder has the following method:
protected FastCopyHashMap<String, String> childValue(final Map<String, String> parentValue) { ... }

The signature of this method is wrong. Since Holder extends InheritableThreadLocal<FastCopyHashMap<String, String>> the correct signature would be:
protected FastCopyHashMap<String, String> childValue(final FastCopyHashMap<String, String> parentValue) { ... }

This can easily be tested by adding the @Override annotation to the method.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list