Issue 8850 - Split thread pool shutdown and destruction
Summary: Split thread pool shutdown and destruction
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: 2.5.0
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-09 15:10 UTC by Ondřej Kuzník
Modified: 2020-10-14 21:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ondřej Kuzník 2018-05-09 15:10:27 UTC
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.
Comment 1 OpenLDAP project 2018-11-01 18:12:18 UTC
Added to master
Comment 2 Quanah Gibson-Mount 2018-11-01 18:12:18 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Enhancements