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

Remko Popma edited comment on LOG4J2-1121 at 9/14/15 5:30 PM:
--------------------------------------------------------------

The original solution covered more than the current one but not 100%. There has 
always been a (very small) race condition where threads using the old config 
that haven't increased the counter yet get suspended and are resumed after 
appenders are stopped. 

Fortunately the way you designed the Appender (with the ref-counting Manager) 
meant that in practice, for the vast majority of reconfigurations even that 
race condition would not result in dropped events. This design is probably what 
prevented issues in spite of changes to AbstractConfiguration.stop (for 
LOG4J2-511 and LOG4J2-392) that broke the counter/waitForCompletion design. 

I merely propose that we simplify things by moving the wait from 
{{waitForCompletion}} to LoggerContext.setConfiguration, and that we wait 
unconditionally instead of trying to only wait when necessary. 


was (Author: [email protected]):
The original solution covered more than the current one but not 100%. There has 
always been a (very small) race condition where threads using the old config 
that haven't increased the counter yet get suspended and are resumed after 
appenders are stopped. Fortunately the way you designed the Appender (with the 
ref-counting Manager) meant that in practice, for the vast majority of 
reconfigurations even that race condition would not result in dropped events. 

I merely propose that we simplify things by moving the wait from 
{{waitForCompletion}} to LoggerContext.setConfiguration, and that we wait 
unconditionally instead of trying to only wait when necessary. 

> LoggerConfig performance improvement: remove waitForCompletion and associated 
> fields
> ------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1121
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1121
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.3
>            Reporter: Remko Popma
>
> This ticket follows up on LOG4J2-1120. Out of the three changes identified in 
> LOG4J2-1120, only two could be implemented in time for the 2.4 release.
> This ticket tracks the remaining work for the third change:
> * Since {{clearAppenders()}} is only called after all appenders have been 
> stopped, {{waitForCompletion()}} may no longer be necessary (unless I am 
> missing something here). If so, the {{shutdownLock}}, {{shutdown}} and 
> {{counter}} fields can be removed. Not incrementing the atomic counters with 
> every event in the hot path should give better performance.
> LOG4J2-1120 shows benchmark results that support this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to