Skip to content

Add reflection hints for better native-image support#2432

Merged
violetagg merged 1 commit into
mainfrom
native-config
Aug 16, 2022
Merged

Add reflection hints for better native-image support#2432
violetagg merged 1 commit into
mainfrom
native-config

Conversation

@violetagg

Copy link
Copy Markdown
Member

When a ChannelHandler is added to the Netty channel pipeline and if the ChannelHandler
implements ChannelInboundHandler/ChannelOutboundHandler,
io.netty.channel.ChannelHandlerMask#mask0 will inspect the ChannelHandler's methods for
io.netty.channel.ChannelHandlerMask.Skip annotation.
When there are no reflection hints, NoSuchMethodException is thrown when trying to query the methods with reflection.
This will lead to methods marked as not skippable, although the program will be able to run
without any problems, when all methods are marked as not skippable, one might observe performance issues.

Fixes #2419

When a `ChannelHandler` is added to the `Netty` channel pipeline and if the `ChannelHandler`
implements `ChannelInboundHandlers`/`ChannelOutboundHandlers`,
`io.netty.channel.ChannelHandlerMask#mask0` will inspect the `ChannelHandler's` methods for
`io.netty.channel.ChannelHandlerMask.Skip` annotation.
When there are no reflection hints, `NoSuchMethodException` is thrown when trying to query the methods with reflection.
This will lead to methods marked as not skippable, although the program will be able to run
without any problems, when all methods are marked as not skippable, one might observe performance issues.

Fixes #2419
@violetagg violetagg added the type/enhancement A general enhancement label Aug 15, 2022
@violetagg violetagg added this to the 1.1.0-M6 milestone Aug 15, 2022
@violetagg violetagg requested a review from a team August 15, 2022 13:16
@sdeleuze

Copy link
Copy Markdown
Contributor

This PR looks fine to me, there is no conditional configuration but since this is just configuration query method access, the impact on footprint should be low.

Also that's great to have tests checking no implementation is missed.

@pderop pderop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sounds good to me.

@violetagg

Copy link
Copy Markdown
Member Author

@sdeleuze @pderop Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add native-image support

3 participants