summaryrefslogtreecommitdiff
path: root/src/providers/ldap/ldap_id_enum.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-12-08 15:47:29 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-12-17 16:16:27 -0500
commit6c4661b78edafbd5b44e0c6319243e6671260bd0 (patch)
tree08ee9b3773deca99e6e3c07bb917abaf6413e510 /src/providers/ldap/ldap_id_enum.c
parent5dca77263340b272bfa51de0fe9729fa4a292306 (diff)
downloadsssd-6c4661b78edafbd5b44e0c6319243e6671260bd0.tar.gz
sssd-6c4661b78edafbd5b44e0c6319243e6671260bd0.tar.bz2
sssd-6c4661b78edafbd5b44e0c6319243e6671260bd0.zip
Start first enumeration immediately
Previously, we would wait for ten seconds before starting an enumeration. However, this meant that on the first startup (before we had run our first enumeration) there was a ten-second window where clients would immediately get back a response with no entries instead of blocking until the enumeration completed. With this patch, SSSD will now run an enumeration immediately upon startup. Further startups will retain the ten-second delay so as not to slow down system bootups. https://fedorahosted.org/sssd/ticket/616
Diffstat (limited to 'src/providers/ldap/ldap_id_enum.c')
-rw-r--r--src/providers/ldap/ldap_id_enum.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c
index f2ac8c6a..8695f355 100644
--- a/src/providers/ldap/ldap_id_enum.c
+++ b/src/providers/ldap/ldap_id_enum.c
@@ -134,12 +134,26 @@ static void ldap_id_enumerate_reschedule(struct tevent_req *req)
uint64_t err;
struct timeval tv;
int delay;
+ errno_t ret;
if (tevent_req_is_error(req, &tstate, &err)) {
/* On error schedule starting from now, not the last run */
tv = tevent_timeval_current();
} else {
tv = ctx->last_enum;
+
+ /* Ok, we've completed an enumeration. Save this to the
+ * sysdb so we can postpone starting up the enumeration
+ * process on the next SSSD service restart (to avoid
+ * slowing down system boot-up
+ */
+ ret = sysdb_set_enumerated(ctx->be->sysdb,
+ ctx->be->domain,
+ true);
+ if (ret != EOK) {
+ DEBUG(1, ("Could not mark domain as having enumerated.\n"));
+ /* This error is non-fatal, so continue */
+ }
}
talloc_zfree(req);