logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: LoggerContext locking
Date Mon, 06 Apr 2015 16:36:12 GMT
Getting on the road, will ponder this afternoon...


On Mon, Apr 6, 2015 at 9:02 AM, Ralph Goers <ralph.goers@dslextreme.com>

> I’ve been looking at the deadlock that is documented in LOG4J-982.  It
> seems to me that the problem is that get/setConfigLocation and reconfigure
> are locking the whole LoggerContext.  First, the history shows that I added
> get & setConfigLocation as part of LOG4J2-207. I think Remko actually wrote
> the code.  I am not sure why these methods need to be synchronized.
> Wouldn’t it be enough for configLocation to be volatile?
> Second, I don’t think locking the LoggerContext for the entirety a
> reconfigure is a good idea. reconfigure calls setConfiguration, which is
> also synchronized. It seems to me that while setConfiguration does need to
> be locked, it should be using a lock that specifically only prevents
> setConfiguration from being executed simultaneously from more than one
> thread.
> Thoughts?
> Ralph
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org

E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

View raw message