From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15452 invoked by alias); 18 Jun 2014 08:33:15 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 15442 invoked by uid 89); 18 Jun 2014 08:33:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Jun 2014 08:33:08 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 043418E05FF; Wed, 18 Jun 2014 10:33:05 +0200 (CEST) Date: Wed, 18 Jun 2014 08:33:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: timeout in LDAP access Message-ID: <20140618083304.GV23700@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20140617100011.GL23700@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CVXKxAdNG2kQIXaJ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2014-06/txt/msg00263.txt.bz2 --CVXKxAdNG2kQIXaJ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 3191 On Jun 18 00:41, Denis Excoffier wrote: > Hi Corinna, >=20 > On 2014-06-17 12:00, Corinna Vinschen wrote: > >=20 > > So I expect an LDAP_SUCCESS with ldap_count_entries() =3D=3D 0 and then > > repeat the request. But the code doesn't expect LDAP_TIMEOUT in this > > case. Do I have to handle LDAP_TIMEOUT here as well? > LDAP_TIMEOUT can occur there. I can even suppose it occurs more > frequently for the _last_ 100-sid chunk (eg there are 5868 users in > a domain, and timeout occurs after 5800 and the last 68 get lost). But > it can also occur after 27 chunks while about 350000 users are still to be > read in a given domain (yes, that makes about 352700 users in a single do= main). >=20 > I=E2=80=99m pretty convinced today that 300 is more than enough, Much more than enough. 300 seconds? 5 minutes? For 100 SIDs? > and that with 3, only > one or two timeouts are to be expected for an AD with 500000 users and no= t so > many domains (50 or 100). The flaw is that as soon as the first timeout o= ccurs, > the whole rest of the current domain is skipped, which can be much in som= e cases. > ldap_get_next_page_s() should perhaps deserve a second chance (with timeo= ut 30s). > After all, this function is called 3527 times (for the same domain). >=20 > Also a simple observation: if LDAP_TIMEOUT is not to be expected, what is= the > use of this timeval* parameter in ldap_get_next_page_s()? >=20 > > I'm wondering if the timeout, at least for enumerating accounts, should > > go away entirely. In case of a connection problem this could result in > > a hang for about 2 minutes by default I think (LDAP_OPT_PING_LIMIT). > I think i like this (it it works). But in this case, it will not resume > to the next domain, and the whole operation (eg getent) is interrupted? I don't quite understand the question. All LDAP operations have a default timeout of 2 minutes if LDAP_OPT_TIMEOUT is not set. The operations we're doing here are pretty simple ones, the bunch of 100 SIDs per getpwent LDAP call is a really small dataset (about 4K bytes) of indexed data, which should be readily available. And there's a certain (not Cygwin-specific) expectation that a simple LDAP operation is fast. Assuming the server takes more than just 3 seconds to reply to a single request for some reason, let's say 30 seconds. The call will result in a laming output of getent, of course, but it would have no other consequences. If the server needs actually more than two minutes to reply, and doesn't return a ping either, the timeout is a very likely indication that we have network problems, or the server is down. In that case, the normal code path applies. The connection with the server will be closed and we try the next domain. The idea I was proposing was just to drop all attempts to seconds guess how fast a DC replies. We're going to use LDAP with default settings and that's it. Default settings means, every operation times out after the default timeout period of 120 seconds, which should really be sufficient. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --CVXKxAdNG2kQIXaJ Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJToU7AAAoJEPU2Bp2uRE+gBeUP/1lLR5HTEypOfJgrel9Fkt94 wdlFDITDlRmb3DBZGAabnUwne3wExo+MCAzaAF9L6+/fNZbXlwprKdHXWgIegelp /6IIwEFwwUEv+3eMZcYFypNYNam6Kzg8wKJ1ktX6Py94d+deSQv1mMNo2+7YAO4b UPIALMD8aXhHPsVg+1L3DJgkzJYRuV4UxmMVorqh/kBV7LTnUIpt2XnHuEhHO9ML OsRTJr28JunP+6mhJKKSSoHcQB7GOsPXrrt/rWYgU4e+O7lwrsQnBuHMvLyEpCUN enPLd8UyTA5Bk5J/Ydo4yrMZDWakRu3XteseqsgP9sTE+afLQd35r7l2CfJKrx2P maQw5AvYltDdk0LEaXDZOeZ4GrDkQ/B2nh5Ly7HDn8S+i1KBTvKBQlwiscyMBbvF dgevQF3yDxjCdrPEqOIs+vs4e+fAyxHeYtbb/9bw2xQuUKvDow/wR5aJULAptYW9 8SXbxZl+SzQVtCaGJq3RGhJ7ujNozr6ku836yy9S7UCly257zE6USeraE4G8roiB Pz6taEg22rT+wH/L+dGeACwZErQmgTN7lvH5K7Yy0KGMnOvg95+TA/rA+KZKuQ0x Z9U3ommFtEt+3aTkFTFtuCksYYtPdMFuj6OL/wYB1UHO/KghiKKekNHIPRDLIOyj tRvXfu0QoYxnQIxzSeQz =yKjO -----END PGP SIGNATURE----- --CVXKxAdNG2kQIXaJ--