Search code examples
vert.xquarkus-native

Quarkus native build Random/SplittableRandom exception with Vert.x Redis Client


I am doing a native build of my Quarkus app and am hitting the UnsupportedFeatureException: Detected an instance of Random/SplittableRandom on a few Vertx Redis Client classes.

I am building using the docker container method: ./mvnw package -Dnative -Dquarkus.native.container-build=true

I have fixed some of the exceptions by including in the pom.xml:

<quarkus.native.additional-build-args>
  --initialize-at-run-time=io.vertx.redis.client.impl.RedisSentinelClient
</quarkus.native.additional-build-args>

but am stuck on this one:

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing
io.vertx.redis.client.impl.RedisClusterConnection.send(io.vertx.redis.client.Request) 
Parsing context:
   at io.vertx.redis.client.impl.RedisClusterConnection.send(RedisClusterConnection.java:117)
   at io.vertx.redis.client.impl.BaseRedisClient.lambda$send$1(BaseRedisClient.java:45)
   at io.vertx.redis.client.impl.BaseRedisClient$$Lambda$1711/0x00000007c1ea57e8.apply(Unknown Source)

I have tried adding

--initialize-at-run-time=io.vertx.redis.client.impl.RedisSentinelClient\,io.vertx.redis.client.impl.RedisClusterConnection
--initialize-at-run-time=io.vertx.redis.client.impl.RedisSentinelClient\,io.vertx.redis.client.impl.BaseRedisClient

and even

--initialize-at-run-time=io.vertx.redis.client.impl.RedisSentinelClient\,io.vertx.redis.client.impl.RedisReplicationConnection.send(io.vertx.redis.client.Request)

but the error persists.

I am fairly new to Java and very new to native building / GraalVM etc

Can anyone shed any light on what class I should add, please?

Thanks, Murray


Solution

  • I believe we can propose a change to vert.x redis client to avoid the split random use. The randomness is there mostly to share the load across nodes. It is not used for any security related features. For this reason, a proposal to either round-robin would probably make more sense as a solution to this issue.