-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
spring-session-data-redis-2.0.4 produces WARN messages when using multiple redis databases
We are using spring-session-data-redis-2.0.4, as part of spring-boot 2.0.3, on redis 2.x,3.x,4.x. For our development servers we are using different redis databases per instance for our session caches.
In spring-session-data-redis-1.x the warning message is not present in the RedisOperationsSessionRepository.onMessage method. This was added in 2.+.
Since messages are not filtered per db we get all key event messages regardless of the database. The listener that is constructed listens for ALL del, expire, and create messages.
What is troubling here, is for events from other dbs spring-session is throwing SessionCreatedEvents with null session objects, which is not correct. For the del/expire case, the warning message is logged, but the events are not created, which I think is less wrong, but still wrong.
When registering the listener in RedisHttpSessionConfiguration, we CAN filter on the database for del/expire messages if we add the database in this configuration, but I don't see a way to filter on the create messages, which could be problematic.
For now I am just setting logging to ERROR for this class, to avoid filling my disks, because we don't use these events, and its a non issue, for us.
Repro Steps:
Connect app1 to redis db0
Connect app2 to redis db1
create and delete a session on app1
notice WARN message in app2
NOTE: make sure key events are enabled.
Thanks in advance,
- Joe