public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: timeout in LDAP access
Date: Mon, 07 Jul 2014 11:07:00 -0000	[thread overview]
Message-ID: <20140707110714.GJ1803@calimero.vinschen.de> (raw)
In-Reply-To: <E3509AAC-C4A0-4293-988F-E94BF2421180@free.fr>

[-- Attachment #1: Type: text/plain, Size: 3286 bytes --]

On Jul  3 22:56, Denis Excoffier wrote:
> On 2014-06-25 23:13 Corinna Vinschen wrote:
> > 
> > You asked for errors being propagated up the chain to the
> > getpwent/getgrent calls and that's exactly what happens now.  There are
> > a lot of LDAP error codes.  How is Cygwin supposed to handle every one
> > of them?  Do we need a list of ignorable and non-ignorable error codes?
> I don’t know. IMHO:
> - a server which is down can be ignored (unless explicitly requested)
> - a timeout, when some output has already been received, must be reported
> - all servers should be treated independently since they are independent
> For the time being, i have added LDAP_SERVER_DOWN in map_ldaperr_to_errno
> at the same place as LDAP_SUCCESS.

I'm wondering if that's the right thing to do.  It feels wrong to
convert a valid error to LDAP_SUCCESS.

Taking a step back, the only reason to ignore such an error would be, if
trying to connect to a domain fails.  If this error occurs somewhere in
the middle, during enumerating a domain, it's a legit error.

I changed pg_ent::enumerate_ad accordingly.

> >> 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.
> > 
> > 60 seconds for 1016 user entries?  That sounds incredibly slow.
> I’m pretty sure that this is due to the non-buffering
> of stderr. In fact, system_printf() is incredibly slow ;-)

Oh, right.  I didn't realize the 60 secs are the time it takes while
stracing.  No worries here.

> > The open function is called for every account, but that doesn't mean it
> > really needs opening.  That's what the early return is for.  The code
> > starts like this:
> >  [...]
> > Did you add the system_printf before the "/* Already open? */" comment,
> > by any chance?
> You’re right. It was before. Now i have it after and there is only one
> such message for the primary domain.
> 
> However, for the non-primary domains the result is the same: i get as
> many cyg_ldap::open()s as accounts. Even more strange, for all these open’s
> (except the first one) the domain variable is printed as (null). Perhaps
> something uncontrolled within pg_ent::enumerate_ad()? Simple suggestion, i
> was not able to understand the logic there.

I can't reproduce this.

For enumerating a non-primary domain, I get exactly two calls to
cyg_ldap::open which actually do a connect.  The first call opens the
domain for enumeration.  The second call opens the primary domain (NULL)
to fetch the POSIX offset value for the foreign domain (see my document
explaining the POSIX offset stuff), unless the application or one of
its parent processes already fetched the POSIX offset for this domain.

I don't observer any further calls to connect in this scenario.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-07-07 11:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 20:39 Denis Excoffier
2014-06-17 10:00 ` Corinna Vinschen
2014-06-17 10:30   ` gecos from AD? (was Re: timeout in LDAP access) Corinna Vinschen
2014-06-17 12:51     ` Corinna Vinschen
2014-06-17 23:07       ` Denis Excoffier
2014-06-18  2:18       ` AW: " Christoph H. Hochstaetter
2014-06-17 22:59     ` Denis Excoffier
2014-06-18  8:38       ` Corinna Vinschen
2014-06-17 22:41   ` timeout in LDAP access Denis Excoffier
2014-06-18  8:33     ` Corinna Vinschen
2014-06-18 18:01       ` Corinna Vinschen
2014-06-19 17:53         ` Denis Excoffier
2014-06-23  9:10           ` Corinna Vinschen
2014-06-23 20:38             ` Denis Excoffier
2014-06-24 15:59               ` Corinna Vinschen
2014-06-25 10:15                 ` Corinna Vinschen
2014-06-25 20:44                   ` Denis Excoffier
2014-06-25 21:14                     ` Corinna Vinschen
2014-07-03 20:57                       ` Denis Excoffier
2014-07-07 11:07                         ` Corinna Vinschen [this message]
2014-07-08 19:34                           ` Denis Excoffier
2014-07-09 10:13                             ` Corinna Vinschen
2014-07-12 13:39                               ` Denis Excoffier
2014-07-14  9:51                                 ` Corinna Vinschen
2014-07-14 13:48                                   ` Corinna Vinschen
2014-07-15 16:29                                     ` Denis Excoffier
2014-07-15 18:20                                       ` Andrey Repin
2014-07-16 13:52                                       ` Corinna Vinschen
2014-07-17  6:33                                         ` Denis Excoffier
2014-07-18 19:18                                           ` Corinna Vinschen
2014-07-28  9:21                                             ` Corinna Vinschen
2014-07-28 18:51                                               ` Denis Excoffier
2014-07-29  9:07                                                 ` Please test AD integration changes, documentation attached (was Re: timeout in LDAP access) Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140707110714.GJ1803@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).