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

ReactiveListOperations left/right pop operations fail with Duration with fractions of second #2975

Open
ai91 opened this issue Aug 21, 2024 · 2 comments
Assignees
Labels
type: bug A general bug

Comments

@ai91
Copy link

ai91 commented Aug 21, 2024

According to documentation, leftPop/rightPop methods expect to get Duration parameter ZERO or >= 1 second.

Failure use case: pass Duration with seconds >= 1 second, and nanos > 0.
Example:

reactiveRedisTemplate.opsForList().leftPop(key, Duration.ofMillis(10100L));

Fails with exception

java.lang.IllegalArgumentException: Duration must be either zero or greater or equal to 1 second

The issue is caused by wrong implementation of DefaultReactiveListOperations.isZeroOrGreaterOneSecond()

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 21, 2024
@christophstrobl christophstrobl self-assigned this Aug 26, 2024
@christophstrobl
Copy link
Member

Thank you @ai91 for bringing this up. We'll look into it.

@christophstrobl christophstrobl added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 26, 2024
@christophstrobl
Copy link
Member

christophstrobl commented Aug 26, 2024

The entire requirement forcing a timeout that is > 1 sec. limits usage of Redis API allowing the timeout to be a

double value specifying the maximum number of seconds to block

We'll need a broader change that also switches the command implementations to use double instead of the current long. The switch from long to double is in since Redis 6. Prior Redis versions are already EOL so I think it's fine to change the current implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants