You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2017/11/10 05:37:00 UTC

[jira] [Comment Edited] (LOG4J2-2106) May blocked when two compress action

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

Ralph Goers edited comment on LOG4J2-2106 at 11/10/17 5:36 AM:
---------------------------------------------------------------

The problem isn't that rollover is synchronized but that checkRollover is synchronized. Two rollovers cannot be allowed to happen concurrently but we should be able to determine if rollovers are required concurrently.

Some of the isTriggeringEvent implementations might require synchronization but not all of them do. Specifically, CronTriggeringPolicy, CompositeTriggeringPolicy and OnStartupTriggeringPolicy do not. Furthermore, SizeBasedTriggeringPolicy and TimeBasedTriggeringPolicy each can be independently synchronized.


was (Author: ralph.goers@dslextreme.com):
The problem isn't that rollover is synchronized but that checkRollover is synchronized. Two rollovers cannot be allowed to happen concurrently but we should be able to determine if rollovers are required concurrently.

> May blocked when two compress action
> ------------------------------------
>
>                 Key: LOG4J2-2106
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2106
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.9.1
>            Reporter: skopt
>
>      My log file is very large, so I set the config about compression. The policies is as follows:
>      <Policies>
>            <OnStartupTriggeringPolicy/>
>            <TimeBasedTriggeringPolicy/>
>      </Policies>
>      When restart the service on the hour,  this will trigger the two policies. And I find that the log can not be written for a while. 
>      I think, there would be two compress actions. In the file RollingFileManager(package org.apache.logging.log4j.core.appender.rolling), the actions will submit to asyncExecutor which will create a new thread for every work. That mean the log file will be compressed by the two actions. Is this the cause?
>  Thanks.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)