Uploaded image for project: 'JBoss Log Manager'
  1. JBoss Log Manager
  2. LOGMGR-35

All threads share the same MDC FastCopyHashMap

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.2.1.GA, 1.3.0.Final
    • 1.2.0.GA
    • core
    • None

      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.

            dlloyd@redhat.com David Lloyd
            sclassen_jira Stephan Classen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: