abbra / slapi-nis

Forked from slapi-nis 6 years ago
Clone

2df48b5 slapi-nis: populate data trees asynchronously after LDAP server startup

Authored and Committed by abbra 8 years ago
    slapi-nis: populate data trees asynchronously after LDAP server startup
    
    Currently slapi-nis design assumes the map cache is populated by
    scanning the original trees on plugin start up. This has few
    consequences:
       - LDAP server cannot serve LDAP clients until all plugins are
         initialized
    
       - slapi-nis cannot ask SSSD to resolve external identities at
         this point as SSSD will need to talk to the LDAP server which
         is at this point not listening for connections. SSSD will put
         whole IPA domain into offline and always will respond
         with negative result
    
    To solve these issues, schedule tree scan after LDAP server startup.
    The problem here is that it is not possible to reliably detect when
    389-ds starts to listen to the incoming connections. However, it is
    possible to schedule an event into 389-ds event queue that will run
    shortly after start of the event loop. Given that the call back function
    which is registered to be called is called within the event loop thread,
    one can fire off another thread and wait in the thread function some
    time until the LDAP server is ready for connections.
    
    The time interval is something that would depend on a specific
    deployment profile but experiments show that having 5 seconds delay
    should be enough as event queue is created just before starting the
    listeners.
    
        
file modified
+94 -16
file modified
+2 -2