You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Some low probability race condition causes lmax to loop indefinitely on Thread.yield
To Reproduce
This was found on a large production system with very low probability. Using log4j with the following setting may cause it:
-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-Dlog4j2.enable.threadlocals=true
-Dlog4j2.enable.direct.encoders=true
-XX:CompileCommand=dontinline,org.apache.logging.log4j.core.async.perftest.NoOpIdleStrategy::idle
Expected behavior
Thread should continue to process events
Desktop (please complete the following information):
OS: Centos 8
Version 5.19.0-0
JVM Version OpenJDK 64-Bit Server VM GraalVM LIBGRAAL 20.3.3 (build 11.0.12+5-jvmci-20.3-b06)
Additional context
It would seem that the queue datastructure becomes corrupted and cas=uses the polling thread to loop infinitely with the following stacktrace:
"Log4j2-TF-1-AsyncLogger[AsyncContext@46f5f779]-1" #18 daemon prio=5 os_prio=0 cpu=4404755.82ms elapsed=4733.22s tid=0x00007fed7ade9800 nid=0xcd runnable [0x00007fed7bffd000]
java.lang.Thread.State: RUNNABLE
at java.lang.Thread.yield([email protected]/Native Method)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.transferAfterCancelledWait([email protected]/AbstractQueuedSynchronizer.java:1752)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos([email protected]/AbstractQueuedSynchronizer.java:2119)
at com.lmax.disruptor.TimeoutBlockingWaitStrategy.waitFor(TimeoutBlockingWaitStrategy.java:38)
at com.lmax.disruptor.ProcessingSequenceBarrier.waitFor(ProcessingSequenceBarrier.java:56)
at com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:159)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
at java.lang.Thread.run([email protected]/Thread.java:829)
The text was updated successfully, but these errors were encountered:
shloim
changed the title
AsyncLogger thread is stuck on 100% CPU on lmax queue polling
[v3.4.2] AsyncLogger thread is stuck on 100% CPU on lmax queue polling
Jan 7, 2024
Describe the bug
Some low probability race condition causes lmax to loop indefinitely on Thread.yield
To Reproduce
This was found on a large production system with very low probability. Using log4j with the following setting may cause it:
-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-Dlog4j2.enable.threadlocals=true
-Dlog4j2.enable.direct.encoders=true
-XX:CompileCommand=dontinline,org.apache.logging.log4j.core.async.perftest.NoOpIdleStrategy::idle
Expected behavior
Thread should continue to process events
Desktop (please complete the following information):
Additional context
It would seem that the queue datastructure becomes corrupted and cas=uses the polling thread to loop infinitely with the following stacktrace:
The text was updated successfully, but these errors were encountered: