Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTL not used #128

Closed
Aurh1l opened this issue Nov 7, 2022 · 9 comments
Closed

TTL not used #128

Aurh1l opened this issue Nov 7, 2022 · 9 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@Aurh1l
Copy link

Aurh1l commented Nov 7, 2022

Hi,

I'm the using the TTL on a Redis Document like that @Document(value = "XXXXX", timeToLive = 60 * 60 * 24 * 7), it works for some keys but after a while the new keys have a TTL equals to -1.

@bsbodden bsbodden self-assigned this Nov 7, 2022
@bsbodden
Copy link
Contributor

bsbodden commented Nov 7, 2022

Thanks for reporting. I'll check it out and try to reproduce it. Any other scenario info you might have is appreciated.

@Aurh1l
Copy link
Author

Aurh1l commented Nov 7, 2022

Thank you.

I'm using redis/redis-stack:edge

Here is my pom:
image

@bsbodden
Copy link
Contributor

bsbodden commented Nov 8, 2022

Can you try with 0.6.2 to confirm that it is still present?

@Aurh1l
Copy link
Author

Aurh1l commented Nov 9, 2022

The bug is still there.
I have to drop the index and restart the application to resolve it, but when I do that the bug appears on another index. I wonder if it's because the restart of an application that the new keys have a bad ttl ?

@bsbodden
Copy link
Contributor

bsbodden commented Nov 9, 2022

With TTLs is pretty hard to debug, I don't have any tests where I simulate the application restarting so that might be the key

@bsbodden bsbodden added the duplicate This issue or pull request already exists label Nov 9, 2022
@bsbodden
Copy link
Contributor

bsbodden commented Nov 9, 2022

See #129

@bsbodden
Copy link
Contributor

@Aurh1l
Copy link
Author

Aurh1l commented Nov 10, 2022

After several tests I think the bug is fixed with this version ! Thank you !

However, I think there is another bug with the TTL but I may be wrong, when a query looks for an element of a key, in my case a hash compute with some elements, that has been erased by the time to live, there is a null pointer exception thrown:

java.lang.NullPointerException
at com.redis.om.spring.repository.query.RediSearchQuery.executeQuery(RediSearchQuery.java:344)
at com.redis.om.spring.repository.query.RediSearchQuery.execute(RediSearchQuery.java:267)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:159)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy174.findByHash(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy174.findByHash(Unknown Source)

Here is the class:

@document(value = "XXXXXX", timeToLive = 10 * 60)
@DaTa
public class XXXXXX {

@Id
private String id;

@Indexed
@NonNull
private String hash;

}

@bsbodden
Copy link
Contributor

@Paure42 can you open another issue for that one? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants