-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Hi,
I've got this exception:
io.lettuce.core.RedisException: java.lang.UnsupportedOperationException
at io.lettuce.core.LettuceFutures.awaitAll(LettuceFutures.java:88)
(...)
Caused by: java.lang.UnsupportedOperationException: null
at java.util.AbstractList.add(AbstractList.java:148)
at java.util.AbstractList.add(AbstractList.java:108)
at io.lettuce.core.output.ListSubscriber.onNext(ListSubscriber.java:47)
at io.lettuce.core.output.KeyValueListOutput.set(KeyValueListOutput.java:56)
at io.lettuce.core.protocol.RedisStateMachine.safeSet(RedisStateMachine.java:373)
at io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:124)
at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:624)
at io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:599)
at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:585)
at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:542)
at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:511)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
My environment:
Lettuce 5.0.1 (the same result with 5.0.2)
Redis 4.0.1
Sample code causing situation:
RedisURI uri = RedisURI.create(redisConnectionString);
RedisClient redisClient = RedisClient.create();
StatefulRedisConnection<String, String> asyncConnection = redisClient.connect(uri);
asyncConnection.setAutoFlushCommands(false);
List<Future<T>> futures = part.stream()
.map(() -> asyncConnection.async().mget(keys))
.collect(Collectors.toList());
asyncConnection.flushCommands();
LettuceFutures.awaitAll(timeoutInSecs, TimeUnit.SECONDS, futures.toArray(new Future[futures.size()]))
Unfortunately I can't reproduce this bug. It happens only on production environment. One idea that I have is that it can be connected with thing that I'm using the same connection for async.set() and there can be concurrent flushes of this commands. I've tried to prepare test which submit these commands concurrently but with no effect. Any other idea?
I've found out that there were similar issues in NestedMultiOutput (#589) so I've submitted MR with similar solution: #710