Skip to content

Spring session redis may create session that never expires #2469

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

Closed
Annaseron opened this issue Oct 12, 2023 · 1 comment
Closed

Spring session redis may create session that never expires #2469

Annaseron opened this issue Oct 12, 2023 · 1 comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug

Comments

@Annaseron
Copy link

Annaseron commented Oct 12, 2023

Describe the bug
some redis session key can be never expires ,with ttl=-1

To Reproduce
Steps to reproduce the behavior.
spring cloud gateway 4.0.7+spring-session-data-redis 3.1.3+redisson-spring-boot-starter 3.23.5

Expected behavior
any redis session key should hava a exipiration;

Sample

send any request to the gateway to create session,
open the redis-cli monitor:
1697092184.031780 [0 10.18.137.27:49859] "EXPIRE" "gateway.spring.session:sessions:fb7eb55a-4999-4e3f-af73-479efe70f343" "3600"
1697092184.031939 [0 10.18.137.27:49861] "HMSET" "gateway.spring.session:sessions:fb7eb55a-4999-4e3f-af73-479efe70f343" "sessionAttr:

as if the commands execution order is random,
if expire command xecutes before the hmset,the expiration time will not work;
if expire command xecutes after the hmset,the expiration time work as expected;
so the keys' ttl will be the default value:-1

@Annaseron Annaseron added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Oct 12, 2023
@Annaseron Annaseron closed this as not planned Won't fix, can't repro, duplicate, stale Oct 12, 2023
@Annaseron
Copy link
Author

Annaseron commented Oct 12, 2023

duplicate as ##2464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant