local session storage not being cleaned up
Hi,
It seems that the cache folder containing the sessions is not being cleaned up by the purgeCentralCache
and purgeLocalCache
scripts for the expired sessions. In our cases this folder is growing up and up and up... We have to clean it up by hand with a rm -rf
. This temporary solution is not acceptable on the long term.
For example on my test server, right now I have 0 session in backend (Redis) and I can list 8 sessions on LemonLDAP file system.
On Redis server :
[root@111111bbbb ~]$ redis-cli -h localhost -p 6379
localhost:6379> keys *
(empty list or set)
On LemonLDAP server :
[root@111111aaaa ~]# /opt/lemonldap-ng/bin/purgeCentralCache
[root@111111aaaa ~]# /opt/lemonldap-ng/bin/purgeLocalCache
[root@111111aaaa ~]# cd /opt/lemonldap-ng/cache/lemonldap-ng-sessions/
[root@111111aaaa lemonldap-ng-sessions]# find . -regextype sed -regex ".*/[0-9a-z]\{40\}"
./e/2/c/e2cbfb544e11dff8082cdc9b0de1ab105e421d61
./4/d/0/4d049020c55bc656be5efc3573c0f8fe22a9a1dc
./4/8/b/48bf760cc604582205f5100981ee3ca9dd398e14
./5/4/b/54b24021cc9464be5dff9cf05b1d1d6f1ed034d2
./3/a/d/3ad03d3a5d709317508fc869a026ef1b5c479fe9
./2/b/3/2b3b8a5c242877b3ab29d034b3a0c43315fd9fcb
./0/3/d/03dcfe4d5c1965ea8cb7303a8f6504622f90ce02
./d/c/7/dc7a883fa5c76e8f3e429e66622f34951b1af1fb
Cron is configure as follow :
lemonldap-ng-portal
# Regular cron jobs for LemonLDAP::NG
#
*/10 * * * * apache [ -x /opt/lemonldap-ng/bin/purgeCentralCache ] && /opt/lemonldap-ng/bin/purgeCentralCache
lemonldap-ng-handler
# Regular cron jobs for LemonLDAP::NG
#
1 * * * * apache [ -x /opt/lemonldap-ng/bin/purgeLocalCache ] && /opt/lemonldap-ng/bin/purgeLocalCache
I will give you all parameters related to storage as I'm not sure which is used and when.
Our lemonldap-ng.ini
file looks like this :
[all]
globalStorage = Apache::Session::Browseable::Redis
globalStorageOptions = { sentinels => ['192.168.50.10:26379', '192.168.50.11:26379', '192.168.50.12:26379'], service => 'mymaster', 'generateModule' => 'Lemonldap::NG::Common::Apache::Session::Generate::SHA256', }
Our lmConf
file looks like this :
"globalStorage":"Apache::Session::File",
"globalStorageOptions":{
"generateModule":"Lemonldap::NG::Common::Apache::Session::Generate::SHA256",
"Directory":"/opt/lemonldap-ng/lib/sessions",
"LockDirectory":"/opt/lemonldap-ng/lib/sessions/lock"
},
"localSessionStorage":"Cache::FileCache",
"localSessionStorageOptions":{
"cache_root":"/opt/lemonldap-ng/cache",
"cache_depth":3,
"directory_umask":"007",
"default_expires_in":600,
"namespace":"lemonldap-ng-sessions"
},
"persistentStorage":"Apache::Session::File",
"persistentStorageOptions":{
"Directory":"/opt/lemonldap-ng/lib/psessions",
"LockDirectory":"/opt/lemonldap-ng/lib/psessions/lock"
},
We use LemonLDAP 1.9.6, Redis 3.0.7 and Redhat / Centos 7.2. Please tell me if you need more info.
Could you investigate to see if you are able to reproduce this bug ?
Best regards, Romain.