logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian.H...@equifax.com
Subject RE: MDC copies
Date Wed, 04 Feb 2004 21:46:53 GMT

> How could ConcurrentModificationExceptions occur? Log4j components do
> modify objects stored in the MDC. They but do not write... 
> Whatama-missing-here?

The issue is not log4j per se. The exception is a result of fail-fast

If code in the main thread writes to MDC and a shallow copy is made and
sent to the async appender and something in a chained, async appender is
iterating over something in shared context while the main thread writes
more to that context, the exception occurs. 

This is only an issue if you are iterating over something INSIDE MDC,
not MDC itself.

A bigger problem is actually that the asychronous logging will
potentially log the WRONG data if the main thread changes context prior
to it having an opportunity to logged the buffered event.


To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message