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

Chetan Mehrotra commented on SLING-7239:
----------------------------------------

Fixed this with 
[commit|https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-commons-log.git;a=commitdiff;h=3271098b98cc661a3ee3cdb72aa1ef653b5d873d]

The test creates around 200+ OSGi config for loggers which then fails on my 
setup as number of log files created are lesser. Post fix the test passes. The 
test does not fail for lower config count like 100 on my machine. So failure 
depends on machine as it is due to race condition

> LogbackManager may miss out some OSGi config at time of startup
> ---------------------------------------------------------------
>
>                 Key: SLING-7239
>                 URL: https://issues.apache.org/jira/browse/SLING-7239
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: Commons Log 5.0.4
>
>
> {{LogbackManager}} currently upon construction reads all the OSGi config and 
> configure them in Logback. Config which comes laters leads to logback reset. 
> However during the time when its getting constructed it has a logic to ignore 
> the reset flag initialization for startup. This may lead to a race condition 
> where some OSGi configs are picked up while it is getting constructed and 
> some OSGi config arriving later are not picked up. For e.g.
> # LogbackManager constructor is invoked
> # It constructs LogConfigManager which registers the managed services
> # ManagedServices receive some OSGi config and push them to LogConfigManager
> # LogbackManager picks them up and add them to Logback but still startup is 
> not finished i.e. started = true is not called
> # Some more OSGi config arrive - These would get ignored as 
> LogbackManager#configChanged would ignore the calls because started != true
> # LogbackManager startup completes and started = true
> So here configs at #5 would not be picked up unless at #7 some more OSGi 
> config arrive. Or some one modifies the config post system start



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

Reply via email to