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

2022-05-13 Thread Maksim Fedorov (Jira)


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

Maksim Fedorov commented on LOG4J2-3505:


{code:java}
@Override
public EventRoute getRoute(long backgroundThreadId, Level level) {
DISCARD_COUNT.incrementAndGet(); // AtomicLong
return EventRoute.DISCARD;
}
{code}
I guess multiple contexts aren't really a thing that we intended to have, so we 
can definitely try switching to {{BasicAsyncLoggerContextSelector}}. May this 
be the cause of our issue?

> 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)


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

2022-05-13 Thread Carter Kozak (Jira)


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

Carter Kozak commented on LOG4J2-3505:
--

It's potentially odd that there are two {{AsyncLogger}} threads consuming 
ring-buffers -- can you confirm that you expect multiple contexts? Otherwise 
you may want to specify 
{{-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector}}
 which doesn't attempt to create a separate context per classloader. 

> 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)


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

2022-05-13 Thread Carter Kozak (Jira)


[ 
https://issues.apache.org/jira/browse/LOG4J2-3505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)