spring-projects / spring-projects/spring-session

RedisConnectionFailure because of Spring Session inactivity

Open
#602 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

Hi @rwinch ,

We are using Spring Session 1.1.1 and have set a timeout of 30 minutes.

After the application is inactive for about 20 minutes ( for example) , when i come and access something on the application, I get the RedisConnectionFailure exception. But this is very inconsistent as immediately if I make the request again, it works. Any idea why this might be happening?

{"error":"Internal Server Error","exception":"org.springframework.data.redis.RedisConnectionFailureException","message":"Unexpected end of stream.; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream."}

Also, request.getSession(false) throws null, even when session exists at times!

Regards,
Adith Shenoy

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the intermittent RedisConnectionFailureException after inactivity with Spring Session 1.1.1, focusing on the request that first accesses the application and on request.getSession(false). Trace the Redis session access and connection lifecycle using the available logs. Done means identifying the cause of the dropped connection or missing session and documenting a verified fix or reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis, spring
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.