Skip to content

Commit

Permalink
netgroups: honor cache_refresh_percent
Browse files Browse the repository at this point in the history
The value of cache refresh percent was not passed to cache_req.

Steps to reproduce:
1. Configure SSSD like so:
```ini
[nss]
entry_cache_nowait_percentage=10
memcache_timeout=0

[domain/mydomain]
entry_cache_timeout = 30
```

2. Run SSSD
3. Fetch netgroup for the first time
4. Wait 15 seconds (midpoint refresh will be triggered from 10-29 seconds interval)
5. Fetch netgroup again, see in logs that midpoint refresh was triggered

Resolves:
https://pagure.io/SSSD/sssd/issue/3947

Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
  • Loading branch information
pbrezina authored and jhrozek committed Mar 14, 2019
1 parent 640edac commit ce8a607
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/responder/nss/nss_enum.c
Expand Up @@ -93,7 +93,8 @@ nss_setent_internal_send(TALLOC_CTX *mem_ctx,
/* Create new object. */
state->enum_ctx->is_ready = false;
subreq = cache_req_send(req, ev, cli_ctx->rctx, cli_ctx->rctx->ncache,
0, CACHE_REQ_POSIX_DOM, NULL, data);
state->nss_ctx->cache_refresh_percent,
CACHE_REQ_POSIX_DOM, NULL, data);
if (subreq == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send cache request!\n");
ret = ENOMEM;
Expand Down

0 comments on commit ce8a607

Please sign in to comment.