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

 Fix Netty addListener instrumentation #10254

Merged
merged 1 commit into from
Jan 18, 2024
Merged

 Fix Netty addListener instrumentation #10254

merged 1 commit into from
Jan 18, 2024

Conversation

Periecle
Copy link
Contributor

@Periecle Periecle commented Jan 17, 2024

Motivation

PR aims to address two issues with the Netty instrumentation.

  1. The instrumentation of Netty's "addListeners" methods violates the method's contract, failing to check for null values in listeners. In contrast, the original Netty addListeners method omits the processing of listeners that are null. As the advice is executed before Netty addListener, a null pointer exception (NPE) may be encountered.

  2. In cases where the listeners do not require wrapping, the addListeners advice may lose them. To address this issue, the pull request wraps all listeners that require wrapping and leaves those that do not (i.e., already wrapped listeners or Netty-provided listeners) as is.

Additional suggestions

It would be great to backport it to 1.32.x, as this issue breaks a lot of custom Netty-based code.

@Periecle Periecle requested a review from a team as a code owner January 17, 2024 10:37
Copy link

linux-foundation-easycla bot commented Jan 17, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Periecle / name: Roman Kvasnytskyi (9d8e7c3)

@Periecle Periecle changed the title Make Netty Instrumentation more robust  Fix Netty addListener instrumentation Jan 17, 2024
…tion. Add null check validation for Netty listener advice apply
@laurit laurit merged commit 9e208c8 into open-telemetry:main Jan 18, 2024
47 checks passed
laurit pushed a commit to laurit/opentelemetry-java-instrumentation that referenced this pull request Jan 18, 2024
laurit added a commit that referenced this pull request Jan 23, 2024
Co-authored-by: Roman Kvasnytskyi <roman@kvasnytskyi.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants