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 strict context checks #4002

Merged
merged 3 commits into from
Aug 30, 2021
Merged

Fix netty strict context checks #4002

merged 3 commits into from
Aug 30, 2021

Conversation

trask
Copy link
Member

@trask trask commented Aug 28, 2021

most of the netty-4.0 changes were just syncing it with netty-4.1 in order to resolve one of its strict context checks (it was ending the span too early on the first http response chunk)

@trask trask changed the title Fix netty strict context leaks Fix netty strict context checks Aug 29, 2021
@trask trask marked this pull request as ready for review August 29, 2021 02:47
@@ -61,7 +61,15 @@ public void transform(TypeTransformer transformer) {
public static void wrapListener(
@Advice.Argument(value = 0, readOnly = false)
GenericFutureListener<? extends Future<?>> listener) {
listener = FutureListenerWrappers.wrap(Java8BytecodeBridge.currentContext(), listener);
// wrapping our "end" listener leads to strict context leak failures since there will be an
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's good to add the phrasing "We only want to wrap user callbacks"

// wrapping internal netty listeners also leads to strict context leak failures since some of
// those are called after our "end" listener
String listenerClassName = listener.getClass().getName();
if (!listenerClassName.startsWith("io.opentelemetry.javaagent.")
Copy link
Contributor

Choose a reason for hiding this comment

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

ClassValue? :)

@trask trask merged commit 58d640a into open-telemetry:main Aug 30, 2021
@trask trask deleted the fix-netty-strict-context-leaks branch August 30, 2021 16:02
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.

3 participants