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

Re: (ITS#4585) slapd-search generates TIME_WAIT connections increasingly



One thing that occurs to me is that this problem shows up with 
ActiveDirectory, which makes extensive use of referrals to link various 
parts of its DIT together. It strikes me that this problem is related to 
ITS#4545, and that it's just tickling another bug in libldap's referral 
handling, and is not OS-specific at all.

ando@sys-net.it wrote:
>> I note that in libldap tcp_close() wraps a shutdown(2) and a close(2) (at
>> least on Linux) whenever SHUT_RDWD is defined (unless closesocket is
>> defined).  I suggest checking what tcp_close gets defined to (for example,
>> by compiling libraries/libldap/os-ip.c with gcc -E and inspecting the
>> resulting code).  If SHUT_RDWR is not defined on Solaris 9 (I have no
>> means to check right now), shutdown(2) wouldn't be invoked.
>>     
>
> Just for the records: on Solaris 8, shutdown is invoked; connections
> remain in TIME_WAIT (not in CLOSE_WAIT) for a while only at the server's
> side.  Eventually, they get cleared (this happens in minutes, not in
> hours).  The same behavior occurs in Linux.  At the client's side,
> connections get cleared as soon as [tcp_]close() is invoked.  This happens
> irrespective of using AD or OpenLDAP's slapd.  One difference I observe
> between Linux and Solaris is that if slapd-tester is stopped with Ctrl-C,
> client-side connections on Solaris hang out for a while (minutes) in
> TIME_WAIT, while on Linux they get cleared immediately.  in I'm looking
> for pointers in Sun documentation.
>   
-- 
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/