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

Re: (ITS#3471) multiple syncrepl clients blocks other syncrepl clients



hyc@symas.com wrote:

quanah@stanford.edu wrote:


--On Friday, January 07, 2005 8:04 PM +0000 openldap-its@OpenLDAP.org wrote:

Just to follow up, this scenario actually blocks *all* other incoming connections (i.e., you can only have two active connections, everything else times out).

Since the problem is not occurring on Linux, it appears this is a Solaris-specific issue. It sounds very similar to the problem in ITS#3340. Not clear whether it's thread related or something else.

Well, this problem turns out to be quite Solaris-specific. First of all, once the server got busy, it stopped listening to incoming connections. Attaching with gdb showed that the main listener thread was waiting in thread_yield (ldap_pvt_thread_yield) (see line slapd/daemon.c:1720) after having returned from select() with a result of zero (timeout). Apparently the listener thread was not getting back onto the CPU at all while the other threads were running, so it never got back around to select() for new connections again. (The yield at daemon.c: 1969 also seems to be a problem.)

Commenting out this yield call seems to have helped that part of the problem. We then found that even though the connections stopped timing out, there still wasn't very good response from slapd. Attaching with gdb at this point showed multiple threads stuck in a mutex_lock invoked from the syslog() function.

I think we may need these yield() calls on a single-CPU machine, to make sure that incoming operations aren't starved for CPU time. But the test machine is a multi-CPU machine, so that kind of consideration doesn't apply. Also, since this piece of code just loops back to select(), we probably can avoid the yield's altogether when we know that select yields. configure already tests for that, so perhaps we can just surround these calls with #ifndef HAVE_YIELDING_SELECT.

Comments?

--
 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support