Carter Kozak created LOG4J2-2895:
------------------------------------
Summary: 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
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)