38d4e52 Ticket 49873 - (cont 2nd) Contention on virtual attribute lookup

Authored and Committed by tbordaz 5 years ago
    Ticket 49873 - (cont 2nd) Contention on virtual attribute lookup
    
    Bug Description:
    	SSL initialization does internal searches that access the vattr_global_lock
    	Thread private counter needs to be initialized by that time.
    	Currently it is initialized after SSL init.
    
    	Second problem was a leak of one 'int' per worker. It was used to keep the private counter.
    
    Fix Description:
    	Call of vattr_global_lock_create needs to be called before slapd_do_all_nss_ssl_init.
    	Also, 'main' may or may not fork, the initialization fo the thread private variable
    	is done either on the child or parent depending if main forks or not.
    
    	The leak is fixed using a destructor callback of the private variable and so
    	call PR_SetThreadPrivate only if there is no private variable.
    
    https://pagure.io/389-ds-base/issue/49873
    
    Reviewed by: Mark Reynolds, Simon Pichugi (thanks)
    
    Platforms tested: F28
    
    Flag Day: no
    
    Doc impact: no
    
    Ticket foo
    
        
file modified
+9 -0
file modified
+0 -4
file modified
+16 -2