Repository navigation
Description
Hi!
We have a redis server with about 600 commands per seconds sent via redisson. And we have some cronjobs that update information in the db (and cache). We are using redisson 3.12.3 with LocalCachedMap with the following options.
LocalCachedMapOptions.defaults()
.evictionPolicy(LocalCachedMapOptions.EvictionPolicy.LRU)
.syncStrategy(LocalCachedMapOptions.SyncStrategy.INVALIDATE)
.timeToLive(ttlMinutes, TimeUnit.MINUTES);
The synchronization is working great. However, since the cronjob is setting up new connections then disconnects we often during the peak hours receive errors like so
2020-06-08 10:00:07,395 ERROR org.redisson.client.handler.CommandPubSubDecoder - Unable to decode data. channel: [id: 0x62858bf8, L:/10.y.y.y:50724 - R:xxx/10.x.x.x:6379], reply: ReplayingDecoderByteBuf(ridx=49, widx=49)
java.util.concurrent.RejectedExecutionException: Task org.redisson.client.handler.CommandPubSubDecoder$$Lambda$91/1018878170@65cec14d rejected from java.util.concurrent.ThreadPoolExecutor@41eae594[Shutting down, pool size = 10, active threads = 0, queued tasks = 0, completed tasks = 15]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
at org.redisson.client.handler.CommandPubSubDecoder.enqueueMessage(CommandPubSubDecoder.java:171)
at org.redisson.client.handler.CommandPubSubDecoder.decodeResult(CommandPubSubDecoder.java:127)
at org.redisson.client.handler.CommandDecoder.decodeList(CommandDecoder.java:422)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:377)
at org.redisson.client.handler.CommandPubSubDecoder.decodeCommand(CommandPubSubDecoder.java:71)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:134)
at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:91)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:498)
at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
I'm thinking that we can either wait longer for the shutdown or configure the instance not to subscribe to updates? I realize that this might be a weird use case, I tried manually constructing the publish command but got lost somewhere in the command encoding. I'm thinking that ideally a new SyncStrategy that only publish invalidation, and doesn't listen to them, would be the best solution for us.
Activity
mrniko commentedon Oct 17, 2020
I'll add try catch for RejectedExecutionException
55 remaining items