Comments (3)
Hey @Memorydoc ,
from the exception name (org.springframework.data.redis.RedisSystemException) I can only assume you are having issue with the Spring Data Redis and not the Lettuce driver itself?
Anyway to understand the issue better we will need more information like a complete stacktrace or a sample of the code that ptoduces this issue.
from lettuce.
I encountered the same problem when upgrading from Spring boot2.3.4 to 2.7.0
The code example is as follows:
@Test
public void test() {
StringBuilder lua = new StringBuilder();
lua.append("local c");
lua.append("\nc = redis.call('get',KEYS[1])");
lua.append("\nif c and tonumber(c) > tonumber(ARGV[1]) then");
lua.append("\nreturn c;");
lua.append("\nend");
lua.append("\nc = redis.call('incr',KEYS[1])");
lua.append("\nif tonumber(c) == 1 then");
lua.append("\nredis.call('expire',KEYS[1],ARGV[2])");
lua.append("\nend");
lua.append("\nreturn c;");
int limitCount = 10;
int limitPeriod = 3;
List<String> keys = new ArrayList<>();
keys.add("kk");
RedisScript<Number> redisScript = new DefaultRedisScript<>(lua.toString(), Number.class);
Number count = stringRedisTemplate.execute(redisScript, keys, String.valueOf(limitCount), String.valueOf(limitPeriod));
System.out.println(count);
}
The debug code enters the execute
method of the DefaultScriptExecutor
class of spring-data-redis
:
public <T> T execute(final RedisScript<T> script, final RedisSerializer<?> argsSerializer,
final RedisSerializer<T> resultSerializer, final List<K> keys, final Object... args) {
return template.execute((RedisCallback<T>) connection -> {
final ReturnType returnType = ReturnType.fromJavaType(script.getResultType());
final byte[][] keysAndArgs = keysAndArgs(argsSerializer, keys, args);
final int keySize = keys != null ? keys.size() : 0;
if (connection.isPipelined() || connection.isQueueing()) {
// We could script load first and then do evalsha to ensure sha is present,
// but this adds a sha1 to exec/closePipeline results. Instead, just eval
connection.eval(scriptBytes(script), returnType, keySize, keysAndArgs);
return null;
}
return eval(connection, script, returnType, keySize, keysAndArgs, resultSerializer);
});
}
In version 2.3.4, the ReturnType is Integer
and IntegerOutPut
will be generated, but in version 2.7.0, the ReturnType is VALUE
and generates ValueOutPut
, resulting in the above error, so I think ValueOutPut
should support the processing of Number
, which can solve this problem.
from lettuce.
@Memorydoc , @ShepherdZFJ ,
Seems to me this is deffinetly an issue with spring-data-redis, perhaps sometihng like spring-projects/spring-data-redis#2908
This project works on the underlying driver and - unless the driver is the problem - there is nothing to be done in Lettuce.
Closing this, please reopen if you have some indications that the issue is in the Lettuce code.
from lettuce.
Related Issues (20)
- Add option to customize expected exceptions in `DefaultEndpoint` HOT 1
- georaduis command execute error when use ReadFrom.REPLICA_PREFERRED HOT 11
- Hash Field Expiration Support HOT 1
- SSL FULL verify seed connection, but only CA verify for cluster node connections
- Getting the keys from cache returns the wrong amount in cluster mode with replica enabled. HOT 1
- Is client side caching enabled by default in lettuce? If yes, Is there a way to not do client side caching in lettuce? HOT 1
- Seeing Warning Logs :: Cannot refresh Redis Cluster topology in 6.2.6.RELEASE HOT 4
- After turning on topology refresh, lettuce log is written inside rocketmq-client.log. HOT 4
- Lettuce client reconnecting frequently HOT 1
- Custom command with Lettuce occurs UnsupportedOperationException HOT 1
- Stateful redis cluster pubsub is not working HOT 4
- Why does lecttuce send lua script load command to all nodes (including replicas) in redis cluster? HOT 4
- `DefaultClientResources.dnsResolver(DnsResolver resolver)` should be marked as deprecated.
- ClusterTopologyChangedEvent Timing Issue
- Provide a convenience method to support reading of last message from stream
- use with gateway,but something throw io.lettuce.core.output.ValueOutput does not support set(long) HOT 10
- Adjusting disconnectedBehavior Option to Prevent Timeout When Redis Shutdown HOT 6
- Pool exhausted, Java 21 and Virtual Threads HOT 3
- AWS RedisCache replica Failover can not be resolved HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lettuce.