Skip to content

Remove the deprecation of RingBufferLogEventTranslator.updateThreadValues() - #4467

Open
ppkarwasz wants to merge 2 commits into
2.xfrom
fix/2.x/undeprecate-update-thread-values
Open

ppkarwasz wants to merge 2 commits into
2.xfrom
fix/2.x/undeprecate-update-thread-values

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Follow-up to #4280, answering the review question left open there.

#3171 deprecated RingBufferLogEventTranslator.updateThreadValues() and removed its only call, because a translator is only used by the thread that created it. The name and priority of that thread can still change, which is what the UNCACHED thread name strategy is about, so #4280 restored the call in AsyncLogger, but kept the method deprecated.

This PR removes the deprecation and fixes the Javadoc and the field comment that described the thread values as effectively final.

This only concerns 2.x: the deprecation stays on 2.25.x and 2.26.x.

🤖 Generated with Claude Code

…alues()`

Since #4280, `AsyncLogger` calls `updateThreadValues()` again for the
`UNCACHED` thread name strategy: although a translator is only used by
the thread that created it, the name and priority of that thread can
change.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
private String traceFlags;

// Due to the usage pattern of this class, these are effectively final
// Refreshed by `updateThreadValues()`, since the thread name and priority can change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc of updateThreadValues() already says why these change. Can we drop this comment?

Suggested change
// Refreshed by `updateThreadValues()`, since the thread name and priority can change

type="changed">
<issue id="4467" link="https://github.com/apache/logging-log4j2/pull/4467"/>
<description format="asciidoc">
Remove the deprecation of `RingBufferLogEventTranslator.updateThreadValues()`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use this shorter line?

Suggested change
Remove the deprecation of `RingBufferLogEventTranslator.updateThreadValues()`.
Undeprecate `RingBufferLogEventTranslator.updateThreadValues()`.

@ramanathan1504

Copy link
Copy Markdown
Contributor

The Javadoc now matches what AsyncLogger does for the UNCACHED strategy.
main has updateThreadValues() without @Deprecated and has no stale comment there. Can this PR use port-done instead of port-to-main?

@ramanathan1504 ramanathan1504 added async Affects asynchronous loggers or appenders enhancement Additions or updates to features java Pull requests that update Java code labels Nov 10, 2026
@ramanathan1504 ramanathan1504 added this to the 2.27.0 milestone Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async Affects asynchronous loggers or appenders enhancement Additions or updates to features java Pull requests that update Java code port-to-main

Projects

Development

Successfully merging this pull request may close these issues.

2 participants