You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2014/01/27 14:25:37 UTC

[jira] [Commented] (SLING-3341) [logback] Race condition in configuring Logback

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

Chetan Mehrotra commented on SLING-3341:
----------------------------------------

Refactored the logic in http://svn.apache.org/r1561666

> [logback] Race condition in configuring Logback
> -----------------------------------------------
>
>                 Key: SLING-3341
>                 URL: https://issues.apache.org/jira/browse/SLING-3341
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: Commons Log 4.0.0
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>
> Current way to configure Logback works like as below
> 1. Any change in config finally leads a call to org.apache.sling.commons.log.logback.internal.LogbackManager#configChanged
> 2. The config change is not done in concurrent way. A thread must acquire the {{resetLock}} to trigger  Logback reset. If this lock cannot be acquired then it just sets a flag {{configChanged}} to true. The Logback reset job upon completion checks {{configChanged}} . if found to be true then it reschedules the job to load Logback again
> In current impl there is a small race condition where its possible that Logback reset job does not see the {{configChanged}} flag and hence Logback does not get reinitialized and is configured with stale config



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)