logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (LOG4J2-1343) Update ConsoleAppender to utilize gc-free Layout method
Date Fri, 08 Apr 2016 04:47:25 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-1343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Remko Popma reopened LOG4J2-1343:

The current implementation that coarsely locks on the Appender Manager causes a deadlock in

The call sequence became clear after I added some system printouts:

pool-2-thread-1 ThreadedTest$LoggingRunnable@7df67951 calling logger.debug(state)
pool-2-thread-2 ThreadedTest$StateSettingRunnable@20afdd66 locking on state to call state.setState
pool-2-thread-2 ThreadedTest$State@7c7a06ec locked on state, entered setState, calling logger.debug...
pool-2-thread-3 ThreadedTest$LoggingRunnable@215a8856 calling logger.debug(state)
pool-2-thread-4 ThreadedTest$StateSettingRunnable@5f8707b5 locking on state to call state.setState
pool-2-thread-5 ThreadedTest$LoggingRunnable@51b48833 calling logger.debug(state)
pool-2-thread-6 ThreadedTest$StateSettingRunnable@2ba8331b locking on state to call state.setState
pool-2-thread-7 ThreadedTest$LoggingRunnable@1a12ff63 calling logger.debug(state)
pool-2-thread-8 ThreadedTest$StateSettingRunnable@452a6c88 locking on state to call state.setState
pool-2-thread-7 File.directEncodeEvent() synchronizing on manager
pool-2-thread-2 File.directEncodeEvent() synchronizing on manager
pool-2-thread-5 File.directEncodeEvent() synchronizing on manager
pool-2-thread-1 File.directEncodeEvent() synchronizing on manager
pool-2-thread-3 File.directEncodeEvent() synchronizing on manager
pool-2-thread-7 ThreadedTest$State@7c7a06ec locking on state to call state.getState

In the above example thread 2 has a lock on state, and tries to lock on manager (in {{logger.debug("hello")}},
while thread 7 is calling {{logger.debug(state)}}, has a lock on manager and tries to lock
on state (from {{state.toString()}}.

> Update ConsoleAppender to utilize gc-free Layout method
> -------------------------------------------------------
>                 Key: LOG4J2-1343
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1343
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 2.5
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>             Fix For: 2.6
> TBD: would we want to include this in the upcoming 2.6 release?

This message was sent by Atlassian JIRA

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

View raw message