This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: timeout in LDAP access

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 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

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.


Denis Excoffier. 

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]