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

Adds reflection hints for native-image support 1.1.x #1073

Merged
merged 1 commit into from
Sep 13, 2022
Merged

Adds reflection hints for native-image support 1.1.x #1073

merged 1 commit into from
Sep 13, 2022

Conversation

violetagg
Copy link
Contributor

Motivation:

The issues below are observed when trying to test rsocket native-image support
1.

Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: producerIndex",
    "	at io.rsocket.internal.jctools.queues.UnsafeAccess.fieldOffset(UnsafeAccess.java:92) ~[na:na]",
    "	at io.rsocket.internal.jctools.queues.BaseMpscLinkedArrayQueueProducerFields.<clinit>(BaseMpscLinkedArrayQueue.java:53) ~[rsocket:na]",
    "	... 34 common frames omitted",
    "Caused by: java.lang.NoSuchFieldException: producerIndex",
    "	at java.lang.Class.getDeclaredField(DynamicHub.java:968) ~[rsocket:na]",
    "	at io.rsocket.internal.jctools.queues.UnsafeAccess.fieldOffset(UnsafeAccess.java:90) ~[na:na]",
    "	... 35 common frames omitted",
  1. When a ChannelHandler is added to the Netty channel pipeline,
    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.
    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.

Modifications:

  • Add reflection hints for jctools queues
  • Add reflection hints for ChannelHandler's

Result:

No issues when testing rsocket native-image support

Signed-off-by: Violeta Georgieva <violetag@vmware.com>
@OlegDokuka OlegDokuka added this to the 1.1.3 milestone Sep 13, 2022
@OlegDokuka OlegDokuka changed the title Add reflection hints for native-image support 1.1.x Adds reflection hints for native-image support 1.1.x Sep 13, 2022
@OlegDokuka OlegDokuka merged commit f15c14a into rsocket:1.1.x Sep 13, 2022
@violetagg violetagg deleted the native-image-configuration-1_1_x branch September 13, 2022 18:07
OlegDokuka pushed a commit that referenced this pull request Sep 13, 2022
Signed-off-by: Oleh Dokuka <odokuka@vmware.com>
Signed-off-by: Oleh Dokuka <oleh.dokuka@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants