Using Spring Boot 2.0.3 with reactive WebFlux and spring-session-data-redis 2.0.4.
- Suppose we have a long-running web request (for example, WebSocket).
- Execute logout operation while long-running request 1 is still running.
- Session changes its key in Redis.
- When request 1 finishes an operation to save session delta will be executed.
- ReactiveRedisOperationsSessionRepository saves changed fields (for example, lastAccessedTime) USING OLD SESSION KEY.
- So now we have OLD SESSION KEY back in Redis having only one field: lastAccessedTime.
- Any new request which uses OLD SESSION KEY fails in ReactiveRedisOperationsSessionRepository.findById with NullPointerException in SessionMapper because all other fields like creationTime are missing.
- Panic ensues.
EDIT: Created related Spring Framework issue: https://jira.spring.io/browse/SPR-17051