Skip to content
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

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

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Apr 22, 2022

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
Member

LGTM

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.

None yet

4 participants