[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#8850) Split thread pool shutdown and destruction



Full_Name: Ondrej Kuznik
Version: master
OS: 
URL: https://github.com/mistotebe/openldap/tree/ITS8850
Submission from: (NULL) (82.10.24.68)


At the moment, libldap_r only supports one thread pool. Closing and freeing that
pool is currently done in a single step.

If there is a side thread that wants to schedule work into this global pool,
there is currently a (short) window when the thread pool is being destroyed and
that thread has not been notified yet (which only happens after the main slapd
threads have already finished). If a thread tries to schedule more work to be
done, it might trample onto memory/mutexes that have already been released.

The linked patch outlines a solution to the problem by separating
ldap_pvt_thread_pool_destroy into a part that shuts down the pool and the actual
deconstruction. slapd is adapted to call the shutdown at the shutdown point and
only destroy the pool after all backends have been closed.

Tries to maintain backward compatibility.

Any feedback is welcome.