URL: https://github.com/SSSD/sssd/pull/259
Title: #259: RESPONDER: Also populate cr_domains when initializing the 
responders

sumit-bose commented:
"""
I withdraw my suggested patch. I think @fidencio's patch is the better fix.

But I would like to ask you to include something like:

        diff --git a/src/responder/common/cache_req/cache_req.c 
b/src/responder/common/cache_req/cache_req.c
        index 8cb4032..eecbe6c 100644
        --- a/src/responder/common/cache_req/cache_req.c
        +++ b/src/responder/common/cache_req/cache_req.c
        @@ -843,8 +843,17 @@ static errno_t cache_req_process_input(TALLOC_CTX 
*mem_ctx,
             const char *default_domain;
         
             if (cr->data->name.input == NULL
        -            || (cr->plugin->parse_name == false || domain != NULL)) {
        -        return cache_req_update_domains(mem_ctx, req, cr, domain);
        +                || cr->plugin->parse_name == false
        +                || domain != NULL) {
        +        if (cr->rctx->get_domains_last_call.tv_sec == 0) {
        +            return cache_req_update_domains(mem_ctx, req, cr, domain);
        +        } else {
        +            if (cr->data->name.input == NULL) {
        +                return EOK;
        +            } else {
        +                return cache_req_set_name(cr, cr->data->name.input);
        +            }
        +        }
             }
         
             default_domain = NULL;


So that the get_domains request is only send when none so far is finished 
(get_domains_last_call.tv_sec == 0). In general this will not cause an extra 
request because the common data provider code will detect that the request 
started during initialization is still running. But it will prevent that the 
request is called once a minute on a server handling many  client requests of 
the type that will trigger it. Feel free to modify the code if you can think of 
a better way to handle the nested if -blocks, I agree that the one above soes 
not look very nice.

Code which would still run the request e.g. once an hour to make sure that the 
domain list gets updated even if no other type of request will trigger an 
update can imo be added later in a different PR. 
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/259#issuecomment-301708029
_______________________________________________
sssd-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to