Redis Sets data type to store 1 routing key -> n channel(s) mappings
Upon James graceful shutdown:
Redis Pub/Sub channel should be unsubscribed and be disposed by Redis (as long as no more consumer for the channel. BTW 1 consumer - 1 channel mapping)
routing key -> channel(s) mappings should be removed
However, if James crashes, likely the SETS data would not be cleaned by James. We should better clean them as Redis memory usage is critical.
Regarding Redis channel, we need to check if James crashes (no explicit UNSUBSCRIBE command), Redis would clean the channel e.g. on connection close => YES
DoD
Write the task and unit tests.
Guice binding.
Documentation.
Notes
Could take the chance to monitor other potential issues with Redis memory usage too e.g.:
Redis memory leak after each TMail performance test? If yes, what is leaked?
Any chance even when James node works fine, but MUA disconnections and the routing key -> channel(s) mappings would not be clean?
Why
Currently, for Redis event bus keys we use:
Upon James graceful shutdown:
However, if James crashes, likely the SETS data would not be cleaned by James. We should better clean them as Redis memory usage is critical.
How
Suggestion: write a Task/cronjob to clean redundant Redis Sets mappings. cf https://github.com/apache/james-project/pull/2028#discussion_r1502997593
Regarding Redis channel, we need to check if James crashes (no explicit UNSUBSCRIBE command), Redis would clean the channel e.g. on connection close => YES
DoD
Write the task and unit tests. Guice binding. Documentation.
Notes
Could take the chance to monitor other potential issues with Redis memory usage too e.g.: