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

Handle missing methods on ChannelHandlerMask #9221

Merged
merged 1 commit into from Jun 7, 2019

Conversation

Projects
None yet
5 participants
@carl-mastrangelo
Copy link
Member

commented Jun 4, 2019

Motivation:

When Netty is run through ProGuard, seemingly unused methods are removed. This breaks reflection, making the Handler skipping throw a reflective error.

Modification:

If a method is seemingly absent, just disable the optimization.

Result:

Dealing with ProGuard sucks infinitesimally less.

Originally caused by #8988

@netty-bot

This comment has been minimized.

Copy link

commented Jun 4, 2019

Can one of the admins verify this patch?

@normanmaurer

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

@netty-bot test this please

try {
m = handlerType.getMethod(methodName, paramTypes);
} catch (NoSuchMethodException e) {
logger.debug("Class {} missing method {}.", handlerType, methodName, e);

This comment has been minimized.

Copy link
@ejona86

ejona86 Jun 4, 2019

Member

e is being thrown away. Just do logger.debug(e) instead? (Yes, it has a bit less data, but I don't expect the extra data to help too much.)

This comment has been minimized.

Copy link
@normanmaurer

normanmaurer Jun 4, 2019

Member

I think it would be good to log a bit more ... But maybe we should make the log line a big more clear:

logger.debug("Class {} missing method {}, assume we can not skip execution", handlerType, methodName, e);

This comment has been minimized.

Copy link
@carl-mastrangelo

carl-mastrangelo Jun 4, 2019

Author Member

I can add more detail, but I thought I recall trailing throwables being treated special by the logger.

This comment has been minimized.

Copy link
@normanmaurer

normanmaurer Jun 4, 2019

Member

Yes they are treated special...

Handle missing methods on ChannelHandlerMask
Motivation:

When Netty is run through ProGuard, seemingly unused methods are removed.  This breaks reflection, making the Handler skipping throw a reflective error.

Modification:

If a method is seemingly absent, just disable the optimization.

Result:

Dealing with ProGuard sucks infinitesimally less.

@carl-mastrangelo carl-mastrangelo force-pushed the carl-mastrangelo:reflec branch from 5397fb7 to 67d2f6f Jun 4, 2019

@normanmaurer

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

@ejona86 are you ok with the PR as it is now ?

@normanmaurer normanmaurer added this to the 4.1.37.Final milestone Jun 4, 2019

@normanmaurer

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

@netty-bot test this please

@ejona86

ejona86 approved these changes Jun 5, 2019

@normanmaurer normanmaurer merged commit 67ad79d into netty:4.1 Jun 7, 2019

3 checks passed

pull request validation (centos6-java11) Build finished.
Details
pull request validation (centos6-java12) Build finished.
Details
pull request validation (centos6-java8) Build finished.
Details

normanmaurer added a commit that referenced this pull request Jun 7, 2019

Handle missing methods on ChannelHandlerMask (#9221)
Motivation:

When Netty is run through ProGuard, seemingly unused methods are removed.  This breaks reflection, making the Handler skipping throw a reflective error.

Modification:

If a method is seemingly absent, just disable the optimization.

Result:

Dealing with ProGuard sucks infinitesimally less.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.