https://issues.apache.org/bugzilla/show_bug.cgi?id=50486

chahuistle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows XP                  |All

--- Comment #1 from chahuistle <[email protected]> 2011-02-09 10:52:34 EST ---
I had the same problem. However, in one of tomcat's filters, I make sure that,
for each request, the MDC gets cleared.

public final void doFilter(...) throws IOException, ServletException {
    MDC.clear();
}

When I shutdown tomcat, more often than not, I can see the same messages on the
console log. I agree on what kuku said. The code that is "clearing" MDC looks
like:

private
  void clear0() {
    if(!java1 && tlm != null) {
      Hashtable ht = (Hashtable) ((ThreadLocalMap)tlm).get();
      if(ht != null) {
        ht.clear();
      } 
    }
  }

I think the following code would fix it:

private
  void clear0() {
    if(!java1 && tlm != null) {
      Hashtable ht = (Hashtable) ((ThreadLocalMap)tlm).get();
      if(ht != null) {
        ht.clear();
      }
      // clear the thread local map 
      ((ThreadLocalMap)tlm).remove();
    }
  }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to