Seeing unhandled exception when client reacts to sentinel failover
Questions
Version
4.3.8
Context
2023-07-06T12:41:44,081 [vert.x-eventloop-thread-6] ERROR ContextBase - Unhandled exception java.lang.ClassCastException: class io.vertx.redis.client.impl.PooledRedisConnection cannot be cast to class io.vertx.redis.client.impl.RedisStandaloneConnection (io.vertx.redis.client.impl.PooledRedisConnection and io.vertx.redis.client.impl.RedisStandaloneConnection are in unnamed module of loader 'app') at io.vertx.redis.client.impl.RedisSentinelClient.lambda$null$0(RedisSentinelClient.java:91) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:76) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.impl.ContextBase.execute(ContextBase.java:232) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.redis.client.impl.RedisStandaloneConnection.handle(RedisStandaloneConnection.java:362) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.redis.client.impl.RESPParser.handleResponse(RESPParser.java:296) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.redis.client.impl.RESPParser.handle(RESPParser.java:128) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.redis.client.impl.RESPParser.handle(RESPParser.java:24) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.net.impl.NetSocketImpl.lambda$new$1(NetSocketImpl.java:100) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:239) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.streams.impl.InboundBuffer.write(InboundBuffer.java:129) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.net.impl.NetSocketImpl$DataMessageHandler.handle(NetSocketImpl.java:414) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.impl.EventLoopContext.emit(EventLoopContext.java:55) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.impl.ContextBase.emit(ContextBase.java:239) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.net.impl.NetSocketImpl.handleMessage(NetSocketImpl.java:390) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.net.impl.ConnectionBase.read(ConnectionBase.java:157) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:153) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[braincloud-rtt-manager.jar:D4.15.0-398] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[braincloud-rtt-manager.jar:D4.15.0-398] at java.lang.Thread.run(Thread.java:829) ~[?:?]
Do you have a reproducer?
Steps to reproduce
- connect to sentinel ("redis-cli -p 26379"
- initiate failover "sentinel failover
Extra
Using Java 11. Have two types of clients, one does a blpop to listen on a queue, the other subscribes to a channel
can you provide a PR with a modified test that fails like this @rmmasse40 ?
I believe this is exactly what I found in this commit: https://github.com/Ladicek/vertx-redis-client/commit/0dffca4b6907073bdb2ff1ede513df2b9ac194e8
Once the metrics/tracing work is merged, assuming the commit is kept, this would be fixed.
This was fixed in #392 / #398, so the correct milestone here is 4.4.5. Fixed.