Issue 383 - slapd hang on write to wake_sds pair
Summary: slapd hang on write to wake_sds pair
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-11-23 21:37 UTC by jromine@campuspipeline.com
Modified: 1999-12-02 02:56 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 jromine@campuspipeline.com 1999-11-23 21:37:56 UTC
Full_Name: Jeff Romine
Version: devel
OS: Solaris
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (206.81.132.94)


It seems to be possible for the wake_sds socket pair to get
filled up under heavy load.  My proposed fix avoids this by
preventing more than one 1-byte message from being in the
socket-pair at any given time.  The CVS diff for daemon.c is
below:

Index: daemon.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/daemon.c,v
retrieving revision 1.124
diff -r1.124 daemon.c
47a48,49
> static int wake_listener_pending_flag = 0;
> 
49c51,55
< do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0)
---
> do { if (w && !wake_listener_pending_flag) \
> 	{tcp_write( wake_sds[1], "0", 1 ); wake_listener_pending_flag = 1;}}
while(0)
> 
> #define LISTENER_AWAKE() \
> Debug(LDAP_DEBUG_ANY,"LISTENER_AWAKE()\n",0,0,0); wake_listener_pending_flag =
0
592a599
> 			LISTENER_AWAKE();

Comment 1 Kurt Zeilenga 1999-11-29 02:22:58 UTC
Howard commited a change which should resolve this problem
Please test.

At 09:37 PM 11/23/99 GMT, you wrote:
>Full_Name: Jeff Romine
>Version: devel
>OS: Solaris
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (206.81.132.94)
>
>
>It seems to be possible for the wake_sds socket pair to get
>filled up under heavy load.  My proposed fix avoids this by
>preventing more than one 1-byte message from being in the
>socket-pair at any given time.  The CVS diff for daemon.c is
>below:
>
>Index: daemon.c
>===================================================================
>RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/daemon.c,v
>retrieving revision 1.124
>diff -r1.124 daemon.c
>47a48,49
>> static int wake_listener_pending_flag = 0;
>> 
>49c51,55
>< do { if (w) tcp_write( wake_sds[1], "0", 1 ); } while(0)
>---
>> do { if (w && !wake_listener_pending_flag) \
>> 	{tcp_write( wake_sds[1], "0", 1 ); wake_listener_pending_flag = 1;}}
>while(0)
>> 
>> #define LISTENER_AWAKE() \
>> Debug(LDAP_DEBUG_ANY,"LISTENER_AWAKE()\n",0,0,0); wake_listener_pending_flag =
>0
>592a599
>> 			LISTENER_AWAKE();
>
>
>

----
Kurt D. Zeilenga		<kurt@boolean.net>
Net Boolean Incorporated	<http://www.boolean.net/>
Comment 2 Howard Chu 1999-12-02 02:55:45 UTC
With the patch tested and committed in daemon.c rev 1.127, I'm closing this bug
report. Also noting here that the bug was specific to a non-threaded build.
Comment 3 Howard Chu 1999-12-02 02:56:33 UTC
changed state Open to Closed
moved from Incoming to Software Bugs