Skip to content

Reboot Redis service process, unable to receive key expired events #2654

Closed
@Lvbuqing

Description

@Lvbuqing

spring boot v2.7.14

I found the following problem when using the spring-data-redis component to monitor the key expiration function of Redis. Here are the steps to reproduce my problem:

  1. Start Redis normally, and configure the properties of Redis.conf: notify-keyspace-events Ex
  2. Start spring boot
  3. Go to Redis to create a new key, and then set an expiration time of 3 seconds for this key
  4. After 3 seconds, my springboot log output this expired key
    Everything is normal here, continue to operate.
  5. Close the Redis service process, and the springboot log will print the log of Redis connection failure. After about 5 seconds, restart the Redis service process
  6. Repeat step 3. At this time, the springboot log shows that Redis is connected successfully, but I cannot receive the expired key. When I restart springboot, repeat step 3, and I can receive the expired key again.
    To sum up, I suspect that the spring-data-redis component is not fully connected to Redis. After restarting Redis, the system cannot receive a new key with an expiration time.

My configuration is as follows:

image

image

Let me summarize again,
When spring-data-redis is connected normally, restarting the Redis process will result in failure to receive expired keys, but the Redis connection is normal (not sure if it is normal, see the log is normal)

Metadata

Metadata

Assignees

Labels

in:messagingRedis messaging componentsstatus: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions