Skip to content

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

Open
@ai91

Description

@ai91

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()

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions