Skip to content

Fix native compilation with Netty 4.1.50 on GraalVM. #743

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

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

michael-simons
Copy link
Contributor

Netty 4.1.50 needs two fixes for in our setup for native compilation on GraalVM:

  • Remove substitutions for io.netty.handler.ssl.Java9SslEngine. as io.netty.handler.ssl.Java9SslEngine has been removed in Netty 4.1.50, Graal cannot substitute a class not on the classpath.

  • Remove the substitution for the task queue in the io.netty.channel.nio.NioEventLoop class. Thus, the JCTools Mpsc will be used instead.

The Mpsc queues need a bit of reflection to work in native mode, but this is very isolated. Also, Netty upgraded to JCTools 3.0.0 in 4.1.46 and the Mpsc queues now are triggered during class initialition already, even with the substitution.
So we should live with the bits of reflection in native mode and remove the somewhat brittle substitution along the way.

Also it seems that the system property io.netty.noUnsafe which we set in the native-image.properties is not taken into account at all.

Netty 4.1.50 needs two fixes for in our setup for native compilation on GraalVM:

* Remove substitutions for io.netty.handler.ssl.Java9SslEngine. as `io.netty.handler.ssl.Java9SslEngine` has been removed in Netty 4.1.50, Graal cannot substitute a class not on the classpath.

* Remove the substitution for the task queue in the `io.netty.channel.nio.NioEventLoop` class. Thus, the JCTools Mpsc will be used instead.

The Mpsc queues need a bit of reflection to work in native mode, but this is very isolated. Also, Netty upgraded to JCTools 3.0.0 in 4.1.46 and the Mpsc queues now are triggered during class initialition already, even with the substitution.
So we should live with the bits of reflection in native mode and remove the somewhat brittle substitution along the way.

Also it seems that the system property `io.netty.noUnsafe` which we set in the `native-image.properties` is not taken into account at all.
@gjmwoods gjmwoods merged commit 52480f1 into neo4j:4.0 Jul 17, 2020
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