You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Carter Kozak (Jira)" <ji...@apache.org> on 2022/05/13 20:17:00 UTC

[jira] [Commented] (LOG4J2-3505) Threads get stuck inside TimeoutBlockingWaitStrategy when using async logging

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

Carter Kozak commented on LOG4J2-3505:
--------------------------------------

Can you share some details about your DiscardingLogQueueFullPolicy?

> Threads get stuck inside TimeoutBlockingWaitStrategy when using async logging
> -----------------------------------------------------------------------------
>
>                 Key: LOG4J2-3505
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3505
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.17.1
>            Reporter: Maksim Fedorov
>            Priority: Major
>         Attachments: threads.txt
>
>
> In our project we are using log4j2 2.17.1 in async mode with RollingRandomAccessFile appenders, LMAX Disruptor version is 3.4.4. Sometimes our application gets in a situation when some of its threads get stuck infinitely inside Disruptor's {{TimeoutBlockingWaitStrategy#signalAllWhenBlocking}} method, while log4j2 async logger threads are sitting in {{TimeoutBlockingWaitStrategy#waitFor}} (see the attached excerpt from the thread dump). From this point logging stops completely and the abovementioned application threads become unable to make any progress. We added a custom async log queue policy which discards all messages regardless of the log level in case of an overflow, but it didn't help. Here is our logging configuration:
> {noformat}
> -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
> -Dlog4j2.asyncLoggerRingBufferSize=524288
> -Dlog4j2.asyncQueueFullPolicy=com.mycompany.logging.DiscardingLogQueueFullPolicy
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)