-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add basic native-image configuration #1318
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1318 +/- ##
============================================
+ Coverage 80.22% 80.24% +0.01%
- Complexity 6081 6085 +4
============================================
Files 429 429
Lines 20018 20018
Branches 2265 2265
============================================
+ Hits 16060 16064 +4
+ Misses 2912 2909 -3
+ Partials 1046 1045 -1
Continue to review full report at Codecov.
|
Hi @christophstrobl, I've tried with the configuration proposed in this PR with the simple test application I created in #1316 and it doesn't work. Could you please take a look at the reflection and proxy configuration I used here? https://github.com/ilopmar/redis-lettuce-graalvm/tree/master/src/main/resources/META-INF/native-image/example/redis-lettuce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through our code and added a few more items that should go into the Graal native image config.
I can take this PR from here.
@@ -0,0 +1,233 @@ | |||
[ | |||
{ | |||
"name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are netty-related bits. We should remove these and leave configuration up to netty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 feel free to open an issue there
@@ -0,0 +1,3 @@ | |||
[ | |||
["io.lettuce.core.api.sync.RedisCommands","io.lettuce.core.cluster.api.sync.RedisClusterCommands"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need also the following types (going through all places where we create proxies):
- AsyncNodeSelection
- HasTargetConnection
- NodeSelection
- NodeSelectionAsyncCommands
- NodeSelectionCommands
- NodeSelectionPubSubAsyncCommands
- NodeSelectionPubSubCommands
- NodeSelectionPubSubReactiveCommands
- PubSubAsyncNodeSelection
- PubSubNodeSelection
- PubSubReactiveNodeSelection
- RedisAdvancedClusterCommands
- RedisClusterAsyncCommands
- RedisClusterCommands
- RedisClusterPubSubCommands
- RedisCommands
- RedisPubSubAsyncCommands
- RedisPubSubCommands
- RedisSentinelCommands
"allDeclaredConstructors":true | ||
}, | ||
{ | ||
"name":"io.netty.buffer.AbstractByteBufAllocator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Netty types should be managed by netty.
}, | ||
|
||
{ | ||
"name":"io.lettuce.core.protocol.CommandHandler", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need:
- PubSubCommandHandler
- SslChannelInitializer
- SslRedisHandshakeHandler (6.0)
- RedisHandshakeHandler (6.0)
Not sure about CommandEncoder
@@ -0,0 +1,3 @@ | |||
[ | |||
["io.lettuce.core.api.sync.RedisCommands","io.lettuce.core.cluster.api.sync.RedisClusterCommands"] | |||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For dynamic command proxies we additionally need:
["java.lang.reflect.ParameterizedType","io.lettuce.core.dynamic.support.TypeWrapper$SerializableTypeProxy","java.io.Serializable", "java.lang.reflect.TypeVariable"],
"allPublicMethods": true, | ||
"allDeclaredConstructors":true | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional types (for latency tracking, since we do class presence checks)
- org.HdrHistogram.Histogram
- org.LatencyUtils.PauseDetector
- rx.Completable
- reactor.core.publisher.Mono
- io.reactivex.Flowable
- io.reactivex.rxjava3.core.Flowable
Thank you @mp911de. Another thing I haven't managed to get it working is the HdrHistogram and LatencyUtils dependencies. Without them my simple app fails. |
@christophstrobl sorry, I missread that. Understood :-) |
Original pull request: #1318.
Original pull request: #1318.
Thank you for your contribution. That's merged, polished, and backported now. |
A starting point for further improvements.
Add required
proxy-config
andreflect-config
including netty setup allowing unsafe access to certain fields.Also register
DefaultCommandLatencyCollector
for build time initialization.Relates to: #1316