-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.17.1] AsyncLogger thread is stuck on 100% CPU on lmax-34. queue polling #2169
Comments
@shloim, the upcoming Log4j 2 release (i.e., |
Alternatively, can you upgrade your Log4j version to 2.18.0 or later? In 2.18.0 @remkop backported the Lines 34 to 40 in 252f1a6
The difference in the locking mechanism seems relevant to your case. |
Do I need to set a custom WaitStrategy or can I keep the default behavior? |
"Our" |
After switching to log4j 2.18.0 the issue persists but in a different stacktrace:
|
@shloim, can you give |
Hi, It's happening when i use:
Operating system: MacOS 14.4.1 JDK: openjdk:11-jre Overall, i'm thinking this may be by design of the YieldingWaitStrategy which states
Perhaps the Log4j async manual could be more clear which currently states:
|
We can indeed do this. Updated the #2534 description accordingly. |
@shloim, any updates? Were you able to reproduce the issue with Log4j |
The documentation of |
|
Description
Some low probability race condition causes lmax to loop indefinitely on Thread.yield
Configuration
-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
Version: 2.17.1
Operating system: Centos 8
JDK: OpenJDK 64-Bit Server VM GraalVM LIBGRAAL 20.3.3 (build 11.0.12+5-jvmci-20.3-b06)
Logs
It would seem that the queue datastructure becomes corrupted and cas=uses the polling thread to loop infinitely with the following stacktrace:
Reproduction
This was found on a large production system with very low probability. Using log4j with the above settings. We don't know the exact case where the polling thread reaches this state
The text was updated successfully, but these errors were encountered: