Fix native compilation with Netty 4.1.50 on GraalVM. #742
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.
@gsmet ping us in quarkusio/quarkus#10200 that the 4.1 driver fails to work with Quarkus in native mode. After investigation it is apparent that the failure is due to an upgrade to Netty 4.1.50.
To fix this, several things are needed:
io.netty.handler.ssl.Java9SslEngine
io.netty.handler.ssl.Java9SslEngine
has been removed in Netty 4.1.50, Graal cannot substitute a class not on the classpath.This removes the substitution for the task queue in the
io.netty.channel.nio.NioEventLoop
class. Thus, the JCTools Mpsc queues 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.
This should be cherry picked into 4.0 as well.
I'll raise at least an issue for discussion with Netty regarding the reflection config for JCTools. cc @normanmaurer