[ 
https://issues.apache.org/jira/browse/LOG4J2-2631?focusedWorklogId=261049&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-261049
 ]

ASF GitHub Bot logged work on LOG4J2-2631:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jun/19 19:10
            Start Date: 16/Jun/19 19:10
    Worklog Time Spent: 10m 
      Work Description: carterkozak commented on pull request #278: 
LOG4J2-2631: RoutingAppender PurgePolicy implementations don't remove …
URL: https://github.com/apache/logging-log4j2/pull/278#discussion_r294096681
 
 

 ##########
 File path: 
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/RoutingAppender.java
 ##########
 @@ -224,13 +224,16 @@ public void append(LogEvent event) {
             control.callAppender(event);
         }
 
-        if (purgePolicy != null) {
+        if (purgePolicy != null
+                // LOG4J2-2631: PurgePolicy implementations do not need to be 
aware of appenders that
+                // were not created by this RoutingAppender.
+                && !referencedAppenders.containsKey(key)) {
 
 Review comment:
   This check is a bit odd, I considered another approach where the concurrent 
map uses a value with additional metadata describing whether or not the 
appender is based on a reference. Unfortunately that approach would still 
require two concurrent maps in order to avoid concurrency issues, so I opted 
against it in favor of the containsKey check here.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 261049)
    Time Spent: 20m  (was: 10m)

> RoutingAppender purge policy should only stop appenders that the 
> RoutingAppender has created
> --------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-2631
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2631
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.11.2
>            Reporter: Carter Kozak
>            Assignee: Carter Kozak
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Routing to other appenders linked by reference rather than creation by node 
> shouldn't cause the purge policy to stop the appender. These appenders should 
> probably be immune from purging altogether.



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

Reply via email to