spring-projects / spring-projects/spring-session

Redis session attributes not thread safe

Open
#3,385 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

the following methods

org.springframework.session.data.redis.ReactiveRedisSessionRepository.createSession()
org.springframework.session.data.redis.RedisSessionMapper.apply(String sessionId, Map<String, Object> map)

create a new "org.springframework.session.MapSession" backed by ReactiveRedisSessionRepository.RedisSession, so getAttributes() return an hashmap; it should be a concurrent hashmap since reactor methods could be executed in different threads

also "ReactiveRedisSessionRepository.RedisSession.delta" should be thread safe

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 with ReactiveRedisSessionRepository.createSession() and RedisSessionMapper.apply(String sessionId, Map<String, Object> map), then inspect ReactiveRedisSessionRepository.RedisSession.delta and the MapSession attributes they create. Confirm the session attributes and delta remain safe when Reactor work runs on different threads, and validate the behavior with the relevant Spring Session tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis, spring
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.