-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-49584][BUILD] Upgrade log4j2 to 2.24.0 #48057
Conversation
Let's test first to confirm whether the previous deadlock issue in 2.23.1 has been resolved in this version. |
A test has failed and needs to be investigated. |
@@ -0,0 +1 @@ | |||
log4j2.garbagefree.threadContextMap = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test("setting to MDC gets logged") {
val mdcPattern = s""""${LogKeys.DATA.name}":"some-data""""
org.slf4j.MDC.put(LogKeys.DATA.name, "some-data")
val logOutputWithMDCSet = captureLogOutput(() => logInfo(msgWithMDC))
assert(mdcPattern.r.findFirstIn(logOutputWithMDCSet).isDefined)
org.slf4j.MDC.remove(LogKeys.DATA.name)
val logOutputWithoutMDCSet = captureLogOutput(() => logInfo(msgWithMDC))
assert(mdcPattern.r.findFirstIn(logOutputWithoutMDCSet).isEmpty)
}
There is a significant refactoring in the ThreadContextMap
component(apache/logging-log4j2#2330), resulting in the loss of key-value pairs injected via org.slf4j.MDC
during the generation of LogEvent
objects when using DefaultThreadContextMap
. As a workaround, it is necessary to configure and employ GarbageFreeSortedArrayThreadContextMap
. I am puzzled by this situation. Since org.slf4j.MDC
is a behavior specific to SLF4J, and this does not appear to be an incompatible change for Log4j, let's currently halt this upgrade and wait to see if the new version of SLF4J can address this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @dongjoon-hyun and @panbingkun for awareness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @gengliangwang , too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, @LuciferYang , there is a PR already from @panbingkun .
ok, let me close this one :) |
What changes were proposed in this pull request?
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?