URL:
https://github.com/SSSD/sssd/pull/420
Title: #420: NSS: memcache_timeout=0
mzidek-rh commented:
"""
I really do believe that it is better to move the memcache related code from
nss_process_init to a separate function and I think it is better to do moves of this kind
before downstream rebases.
There are several reason as to why I moved the code there:
- there is already too much memcache related code in the nss_process_init and moving it to
a static function makes things more readable
- I do not like 'cutting' the nss_process_init function with one check for
timeout==0 and then returning from the function, because there is some code after the
memcache initialization that should be executed and also we could shoot ourselves in the
future by adding non memcache related code after this return that would not be executed
when the timeout is zero. So the only way to solve this is by putting the whole memcache
related stuff into one big if (not good) or move it to a function. I know that there is
also the possibility that you used in your PR to put the condition in the mmap_cache_init
function, but IMO it makes more sense to put this to a function where we read the timeout
value (or all memcache init values to be precise) because it is obvious what effects these
options have to memcache from reading just this function. This benefit will be IMO even
more obvious once we add the options to change memcache sizes.
All in all I do not think it is beneficial for us to go with the minimum lines of code
this time.
"""
See the full comment at
https://github.com/SSSD/sssd/pull/420#issuecomment-338190197