This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: timeout in LDAP access
- From: Denis Excoffier <cygwin at Denis-Excoffier dot org>
- To: cygwin at cygwin dot com
- Date: Wed, 25 Jun 2014 22:44:21 +0200
- Subject: Re: timeout in LDAP access
- Authentication-results: sourceware.org; auth=none
- References: <F312783D-AD66-4614-922B-E44403C7E372 at Denis-Excoffier dot org> <20140617100011 dot GL23700 at calimero dot vinschen dot de> <C462E4F3-1E51-46DC-BD27-BC4786A5E8BB at Denis-Excoffier dot org> <20140618083304 dot GV23700 at calimero dot vinschen dot de> <20140618180102 dot GA27055 at calimero dot vinschen dot de> <FEEBC1A4-B147-45C1-A5AC-F5B9108E998F at Denis-Excoffier dot org> <20140623090959 dot GA1803 at calimero dot vinschen dot de> <C2FB35D9-AE47-4461-8A94-20605D5EB996 at Denis-Excoffier dot org> <20140624155851 dot GJ1803 at calimero dot vinschen dot de> <20140625101526 dot GO1803 at calimero dot vinschen dot de>
On 2014-06-25 12:15, Corinna Vinschen wrote:
>> Stay tuned. I'm rewriting the LDAP access code to perform all critical
>> LDAP calls in interruptible threads. The Windows LDAP calls don't
>> provide any kind of synchronization, only timeouts. I hoped to get away
>> with short timeouts but it seems I hoped in vain.
>>
>> So the next iteration of this code will not use any timeout other than
>> the default LDAP network timeout of 2 minutes, but the calls will be
>> interruptible by signals.
>>
>
> No more artificial timeouts, but the LDAP calls will be interruptible by
> a signal now.
>
> Also, if an error occurs during ad enumeration, getpwent/getgrent will
> return NULL with errno set accordingly.
>
> Please test,
I did. Again, i instrumented ldap.cc by replacing all debug_printf() calls
with system_printf() because my /usr/bin/strace does not work. Again, i
tested with ‘getent passwd > result’ and 'db_enum: all’.
I got the following message:
[ldap_init] getent 6024 cyg_ldap::connect_non_ssl: ldap_bind(xxxxxx.zzz) 0x51
and getent stops after the 376000 users in my own domain. No timeout occurred
but the enumeration was stopped by LDAP_SERVER_DOWN (0x51) [the xxxxxx.zzz
domain name has been edited here but it was completely new to me, never seen
before].
Also, there was a large delay (more than 2 min, say at least 8 minutes) between
the end of output and the end of getent. I got one single system_printf
message (see above).
More than that, i added system_printf("starting open in domain %W", domain)
immediately at the beginning of cyg_ldap::open, and run ‘getent passwd’ now during
one minute (wait 60s, then Control-C). I got 1080 ‘starting open in domain (null)’
messages on stderr and 1016 normal passwd entries on stdout. The discrepancy
1016 vs 1080 is ok because stdout was not properly flushed out.
It seems that
- domain is printed as ‘(null)’? Strange
- there are as many open() calls as passwd entries in the output? Also strange
- EIO (or equivalent) is produced for LDAP_SERVER_DOWN, it probably should be
better if this were not the case?
I suppose it will need more testing, but i’m currently unavailable for tests,
by the way until Friday 08:00 UTC.
Regards,
Denis Excoffier.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple