redis/lettuce

Hexpire and Httl function are not working with the 6.4.0.RELEASE

tanglz opened this issue · 1 comments

Bug Report

Current Behavior

Stack trace
java.util.concurrent.ExecutionException: io.lettuce.core.RedisCommandExecutionException: ERR unknown command `HTTL`, with args beginning with: `TEST_KEY`, `FIELDS`, `2`, `f1`, `f2`, 

	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
	at com.wealthsimple.securitymaster.services.quotes.InternalRedisAsyncCommandsWrapperTest.test hexpire and httl function(InternalRedisAsyncCommandsWrapperTest.kt:129)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
Caused by: io.lettuce.core.RedisCommandExecutionException: ERR unknown command `HTTL`, with args beginning with: `TEST_KEY`, `FIELDS`, `2`, `f1`, `f2`, 
	at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:151)
	at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:120)
	at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:124)
	at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:115)
	at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:749)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:684)
	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:601)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)

Input Code

@test
fun test hexpire and httl function() {
val map = mapOf("f1" to "v1", "f2" to "v2")
asyncCommands.hset("TEST_KEY", map)
asyncCommands.hexpire("TEST_KEY", 10, *map.keys.toTypedArray())
val result = asyncCommands.httl("TEST_KEY", *map.keys.toTypedArray()).get()
assertEquals(listOf(10, 10), result)
}

Input Code
// your code here;

Expected behavior/code

Environment

  • Lettuce version(s): [6.4.0.RELEASE]
  • Redis version: [7.0.12]

Possible Solution

Additional context

Hey @tanglz ,

HTTL is only avalable since Redis 7.4.0, see the documentation:

Available since: 7.4.0