Skip to content

[Tests] Adapt FastThreadLocalStateCleaner to Netty changes: suppress excessive logging in tests - #15269

Merged
eolivelli merged 1 commit into
apache:masterfrom
lhotari:lh-adapt-FastThreadLocalStateCleaner-to-netty-changes
Apr 22, 2022
Merged

[Tests] Adapt FastThreadLocalStateCleaner to Netty changes: suppress excessive logging in tests#15269
eolivelli merged 1 commit into
apache:masterfrom
lhotari:lh-adapt-FastThreadLocalStateCleaner-to-netty-changes

Conversation

@lhotari

@lhotari lhotari commented Apr 22, 2022

Copy link
Copy Markdown
Member

Motivation

FastThreadLocalStateCleaner is used in apache/pulsar tests to clean up state stored in thread local fields using Netty's FastThreadLocal. This solution was added in #10195 to reduce test flakiness caused by state carried on from one test to another.

This change included in 4.1.75.Final added the logging when the thread local state is accessed from another thread. This logging clutters the test run logs and therefore it should be eliminated.
Pulsar was upgraded to Netty 4.1.76.Final in #15212.

Modifications

  • use reflection to access the field directly instead of calling the method that contains the warning logging.

…excessive logging

- suppresses this warning log entry:
  java.lang.RuntimeException: It's not thread-safe to get 'threadLocalMap' which doesn't belong to the caller thread
    at io.netty.util.concurrent.FastThreadLocalThread.threadLocalMap(FastThreadLocalThread.java:80) ~[netty-common-4.1.76.Final.jar:4.1.76.Final]
@lhotari lhotari added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/test doc-not-needed Your PR changes do not impact docs labels Apr 22, 2022
@lhotari lhotari self-assigned this Apr 22, 2022
@lhotari lhotari changed the title [Tests] Adapt FastThreadLocalStateCleaner to Netty changes: suppress excessive logging [Tests] Adapt FastThreadLocalStateCleaner to Netty changes: suppress excessive logging in tests Apr 22, 2022
@eolivelli
eolivelli merged commit 2e5309c into apache:master Apr 22, 2022
@michaeljmarshall

Copy link
Copy Markdown
Member

LGTM

nodece pushed a commit to ascentstream/pulsar that referenced this pull request Sep 11, 2024
…excessive logging (apache#15269)

- suppresses this warning log entry:
  java.lang.RuntimeException: It's not thread-safe to get 'threadLocalMap' which doesn't belong to the caller thread
    at io.netty.util.concurrent.FastThreadLocalThread.threadLocalMap(FastThreadLocalThread.java:80) ~[netty-common-4.1.76.Final.jar:4.1.76.Final]

(cherry picked from commit 2e5309c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/test doc-not-needed Your PR changes do not impact docs type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants