Fix native compilation with Netty 4.1.50 on GraalVM. #743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thenative-image.properties
is not taken into account at all.