[Date Prev][Date Next]
Re: (ITS#6745) HEAD emfile race condition -> slapd stopping listening?
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#6745) HEAD emfile race condition -> slapd stopping listening?
- From: firstname.lastname@example.org
- Date: Fri, 24 Dec 2010 00:15:53 GMT
- Auto-submitted: auto-generated (OpenLDAP-ITS)
> Full_Name: Hallvard B Furuseth
> Version: HEAD
> Submission from: (NULL) (18.104.22.168)
> Submitted by: hallvard
> In HEAD slapd/daemon.c, thanks to HEAD's multiple listener support:
> slap_listener() protects emfile with slap_daemon[0 ].sd_mutex,
> but slapd_remove() protects it with slap_daemon[id].sd_mutex.
> Maybe to compensate, slapd_remove() has code which checks if emfile
> is too big, but nothing checks if it is too small - which looks like
> slapd might never start listening again.
> Simplest fix: add this to slapd_remove():
> if (id) ldap_pvt_thread_mutex_<lock,unlock>(&slap_daemon.sd_mutex );
> slap_daemon.sd_mutex looks quite contended that way, though.
> Maybe a separate emfile_mutex is better.
Alternatively, just skip the check entirely when id != 0. Which would mean
that only closing a session on the first listener would ever trigger the other
listeners to be unmuted. Doesn't seem so terrible; if slapd is actually out of
descriptors one or two connections either way won't make a huge difference in
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/