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

(ITS#6745) HEAD emfile race condition -> slapd stopping listening?



Full_Name: Hallvard B Furuseth
Version: HEAD
OS: 
URL: 
Submission from: (NULL) (129.240.6.233)
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[0].sd_mutex );

slap_daemon[0].sd_mutex looks quite contended that way, though.
Maybe a separate emfile_mutex is better.