You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/01/14 23:01:00 UTC

[jira] [Commented] (LOG4J2-2301) gc-free mixed async loging loses parameter values after the first appender

    [ https://issues.apache.org/jira/browse/LOG4J2-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16742558#comment-16742558 ] 

ASF subversion and git services commented on LOG4J2-2301:
---------------------------------------------------------

Commit dae68a68d6a59468cd15ec3ed0ee42da2457a4b5 in logging-log4j2's branch refs/heads/release-2.x from mprusakov-rbc
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=dae68a6 ]

Remove garbage creation introduced by LOG4J2-2301

After upgrading to 2.11.1 we have started seeing garbage being generated here:

Stack Trace	TLABs	Total TLAB Size(bytes)	Pressure(%)
java.lang.ThreadLocal$ThreadLocalMap.set(ThreadLocal, Object) line: 481	10	3,638,864	56.192
   java.lang.ThreadLocal$ThreadLocalMap.access$100(ThreadLocal$ThreadLocalMap, ThreadLocal, Object) line: 298	10	3,638,864	56.192
      java.lang.ThreadLocal.setInitialValue() line: 184	10	3,638,864	56.192
         java.lang.ThreadLocal.get() line: 170	10	3,638,864	56.192
            org.apache.logging.log4j.core.async.AsyncLoggerConfig.log(LogEvent, LoggerConfig$LoggerConfigPredicate) line: 91	10	3,638,864	56.192

The purpose of this patch is to fix this.

> gc-free mixed async loging loses parameter values after the first appender
> --------------------------------------------------------------------------
>
>                 Key: LOG4J2-2301
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2301
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.11.0
>            Reporter: Carter Kozak
>            Assignee: Carter Kozak
>            Priority: Major
>             Fix For: 3.0.0, 2.11.1
>
>
> When gc-free logging is used with mixed synchronous/asynchronous loggers, parameter values are replaced with "null" after the first AsyncLoggerConfig.
> The message format is still present, as well as the parameter count, however all values are nulls.
> It appears that Log4jEventWrapperHandler.onEvent invokes MutableLogEvent.clear, which nulls out the parameter array.
> I have constructed a failing test (which I need to clean up and deduplicate some code from the fix for LOG4J2-2299):
> https://github.com/cakofony/logging-log4j2/commit/b9c03f5c6881bfe778f8e2d75d046ce6e021c4f1



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)