-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
type: bugA general bugA general bug
Milestone
Description
Bug Report
Current Behavior
We are using spring-session-data-redis(2.0.4) with lettuce in out web applications. we find lettuce keep throwing exception (and cause young gc frequently)
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Throwable.java:783)
- locked <0x00000006dafd9578> (a java.lang.IllegalArgumentException)
at java.lang.Throwable.<init>(Throwable.java:265)
at java.lang.Exception.<init>(Exception.java:66)
at java.lang.RuntimeException.<init>(RuntimeException.java:62)
at java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:52)
at java.lang.Enum.valueOf(Enum.java:238)
at io.lettuce.core.protocol.CommandType.valueOf(CommandType.java:24)
After reading the code, i think the problem may be in https://github.com/lettuce-io/lettuce-core/blob/5.0.4.RELEASE/src/main/java/io/lettuce/core/cluster/RedisState.java#L60
private static CommandType getCommandType(CommandDetail command) {
try {
return CommandType.valueOf(command.getName().toLowerCase());
} catch (IllegalArgumentException e) {
return null;
}
}
enum members are of upper case, but the argument is made lower case.
ava.lang.IllegalArgumentException: No enum constant io.lettuce.core.protocol.CommandType.hscan
io.lettuce.core.cluster.RedisState.getCommandType(RedisState.java:61)
io.lettuce.core.cluster.RedisState.<init>(RedisState.java:48)
io.lettuce.core.cluster.StatefulRedisClusterConnectionImpl.inspectRedisState(StatefulRedisClusterConnectionImpl.java:115)
io.lettuce.core.cluster.RedisClusterClient.connectClusterImpl(RedisClusterClient.java:532)
io.lettuce.core.cluster.RedisClusterClient.connect(RedisClusterClient.java:339)
org.springframework.data.redis.connection.lettuce.ClusterConnectionProvider.getConnection(ClusterConnectionProvider.java:55)
org.springframework.data.redis.connection.lettuce.LettuceConnection.doGetAsyncDedicatedConnection(LettuceConnection.java:962)
org.springframework.data.redis.connection.lettuce.LettuceConnection.getDedicatedConnection(LettuceConnection.java:942)
org.springframework.data.redis.connection.lettuce.LettuceConnection.getConnection(LettuceConnection.java:903)
org.springframework.data.redis.connection.lettuce.LettuceSetCommands.getConnection(LettuceSetCommands.java:516)
org.springframework.data.redis.connection.lettuce.LettuceSetCommands.sAdd(LettuceSetCommands.java:68)
org.springframework.data.redis.connection.DefaultedRedisConnection.sAdd(DefaultedRedisConnection.java:501)
org.springframework.data.redis.core.DefaultSetOperations.lambda$add$0(DefaultSetOperations.java:49)
org.springframework.data.redis.core.DefaultSetOperations$$Lambda$618/1574001204.doInRedis(Unknown Source)
org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184)
org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95)
org.springframework.data.redis.core.DefaultSetOperations.add(DefaultSetOperations.java:49)
org.springframework.data.redis.core.DefaultBoundSetOperations.add(DefaultBoundSetOperations.java:53)
Expected behavior/code
Lettuce do not throw exception when do connection.inspectRedisState()
Environment
- Lettuce version(s): 5.0.4.RELEASE
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug