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

ASF subversion and git services commented on LOG4J2-2895:
---------------------------------------------------------

Commit 2a5665ef8216e753ae9cb4b6c40c8cb1342e6a04 in logging-log4j2's branch 
refs/heads/release-2.x from Carter Kozak
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=2a5665e ]

LOG4J2-2895: Async logging avoids blocking on Log4jThreads


> Async logging should avoid submitting work from Log4jThread threads
> -------------------------------------------------------------------
>
>                 Key: LOG4J2-2895
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2895
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.13.3
>            Reporter: Carter Kozak
>            Assignee: Carter Kozak
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> In order to avoid deadlocks, when we have the option we should try to avoid 
> enqueueing events for async loggers from threads that extend Log4jThread. 
> Submitting events between AsyncLoggerContexts is rare, but can allow multiple 
> disruptors to deadlock feeding events from one to the other. Similarly using 
> both mixed async loggers with AsyncLoggerContext results in events flowing 
> from one disruptor to another.
> There are several areas we can avoid these potential lockups by checking if 
> the current thread is a Log4jThread and logging synchronously. Note that in 
> these cases, events may be serialized to disk in an unexpected order, however 
> the scenario is both sufficiently rare and dangerous that I think it's 
> worthwhile to change.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to