Skip to content

RedisTemplate.expire() overflow [DATAREDIS-286] #863

Closed
@spring-projects-issues

Description

@spring-projects-issues

Eric Wu opened DATAREDIS-286 and commented

The method

RedisTemplate<K, V>.expire(K key, long timeout, TimeUnit unit)

won't work for a timeout of 200 days.

I got this bug after upgrading Spring Data Redis from 1.1.1.RELEASE to 1.2.0.RELEASE.

The root cause is that Jedis is having an issue with the pexpire() method (See Jedis Issue 575, 576, and 577). Basically that method takes an integer as the timeout which easily overflows.

The work-around is to use Jedis's pexpireAt() instead, which takes a long integer.

My environment:

  1. Spring Data Redis 1.2.0-RELEASE
  2. Jedis 2.4.1
  3. Redis 2.8.6

Affects: 1.2.0

Issue Links:

  • DATAREDIS-564 Invoking JedisConnection.expire during transaction/pipelining can cause NPE

Referenced from: pull request #52

Backported to: 1.2.1

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions